AgentFrontCentralizeGoods.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. namespace app\models;
  3. use yii\behaviors\TimestampBehavior;
  4. use yii\db\ActiveRecord;
  5. /**
  6. * This is the model class for table "{{%agent_front_centralize_goods}}".
  7. *
  8. * @property integer $id
  9. * @property integer $front_admin_id
  10. * @property integer $cloud_goods_id
  11. * @property integer $goods_num
  12. * @property integer $sorting_num
  13. * @property integer $supplier_id
  14. * @property string $goods_no
  15. * @property string $attr
  16. * @property string $attr_info
  17. * @property string $goods_name
  18. * @property string $pic_url
  19. * @property integer $status
  20. * @property integer $centralize_goods_type
  21. * @property integer $is_delete
  22. * @property integer $created_at
  23. * @property integer $updated_at
  24. */
  25. class AgentFrontCentralizeGoods extends \yii\db\ActiveRecord
  26. {
  27. const STATUS_SORTING = 0;//分拣中
  28. const STATUS_NO_CAR_LOADING = 1;//分拣完成
  29. const STATUS_CAR_LOADING = 2;//已装车
  30. const STATUS_FINISH = 3;//已完成
  31. /**
  32. * @inheritdoc
  33. */
  34. public static function tableName()
  35. {
  36. return '{{%agent_front_centralize_goods}}';
  37. }
  38. public function behaviors()
  39. {
  40. return [
  41. [
  42. 'class' => TimestampBehavior::class,
  43. 'attributes' => [
  44. ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'],
  45. ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'
  46. ]
  47. ]
  48. ];
  49. }
  50. /**
  51. * @inheritdoc
  52. */
  53. public function rules()
  54. {
  55. return [
  56. [['id', 'front_admin_id', 'cloud_goods_id', 'created_at', 'updated_at', 'is_delete', 'goods_num', 'centralize_goods_type', 'supplier_id', 'sorting_num', 'status'], 'integer'],
  57. [['attr', 'goods_no', 'attr_info', 'goods_name', 'pic_url'], 'string']
  58. ];
  59. }
  60. public function attributeLabels()
  61. {
  62. return [
  63. 'id' => '',
  64. 'front_admin_id' => '仓库ID',
  65. 'cloud_goods_id' => '云仓商品ID',
  66. 'goods_num' => '商品数量',
  67. 'sorting_num' => '已分拣商品数量',
  68. 'goods_no' => '商品规格货号',
  69. 'attr' => '规格',
  70. 'attr_info' => '',
  71. 'goods_name' => '',
  72. 'pic_url' => '',
  73. 'is_delete' => '',
  74. 'created_at' => '',
  75. 'updated_at' => '',
  76. ];
  77. }
  78. }