AdoptGoodsDevice.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. namespace app\models;
  8. use yii\behaviors\TimestampBehavior;
  9. class AdoptGoodsDevice extends \yii\db\ActiveRecord
  10. {
  11. /**
  12. * @inheritdoc
  13. */
  14. public static function tableName()
  15. {
  16. return '{{%adopt_goods_device}}';
  17. }
  18. public function behaviors()
  19. {
  20. return [
  21. [
  22. // 自动更新创建和更新时间
  23. 'class' => TimestampBehavior::class,
  24. 'value' => time()
  25. ]
  26. ];
  27. }
  28. /**
  29. * @inheritdoc
  30. */
  31. public function rules()
  32. {
  33. return [
  34. [['goods_id', 'store_id', 'device_id', 'is_delete'], 'integer'],
  35. [['is_delete'], 'default', 'value' => 0]
  36. ];
  37. }
  38. /**
  39. * @inheritdoc
  40. */
  41. public function attributeLabels()
  42. {
  43. return [
  44. 'id' => 'ID',
  45. 'goods_id' => 'Goods ID',
  46. 'store_id' => 'Store ID',
  47. 'device_id' => '设备ID 多个分类用英文逗号隔开',
  48. 'is_delete' => 'Is Delete',
  49. ];
  50. }
  51. }