Spu.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. namespace addons\WechatMini\common\models\video\spu;
  3. use addons\WechatMini\common\models\video\common\Cate;
  4. /**
  5. * This is the model class for table "{{%addon_wechat_mini_video_spu}}".
  6. *
  7. * @property int|null $product_id 交易组件平台内部商品ID
  8. * @property int $out_product_id 商家自定义商品ID
  9. * @property int|null $merchant_id 商户ID
  10. * @property int|null $store_id 门店ID
  11. * @property string|null $title 标题
  12. * @property string|null $path 路径
  13. * @property string|null $head_img 主图,多张,列表
  14. * @property string|null $desc_info 商品详情图文
  15. * @property string|null $audit_info 修改时间记录
  16. * @property string|null $reject_reason 审核原因
  17. * @property int $third_cat_id 品类
  18. * @property int $brand_id 品牌
  19. * @property string|null $qualification_pics 商品资质图片
  20. * @property string|null $info_version 预留字段,用于版本控制
  21. * @property string|null $scene_group_list 商品使用场景
  22. * @property string|null $delist_info
  23. * @property string|null $spu_attrs
  24. * @property string|null $sale_time
  25. * @property string|null $labels
  26. * @property string|null $promoter_wechat_numbers
  27. * @property string|null $cats
  28. * @property int|null $status 状态
  29. * @property int|null $edit_status 审核状态
  30. * @property int|null $create_time 创建时间
  31. * @property int|null $update_time 修改时间
  32. */
  33. class Spu extends \yii\db\ActiveRecord
  34. {
  35. /**
  36. * {@inheritdoc}
  37. */
  38. public static function tableName()
  39. {
  40. return '{{%addon_wechat_mini_video_spu}}';
  41. }
  42. /**
  43. * {@inheritdoc}
  44. */
  45. public function rules()
  46. {
  47. return [
  48. [['product_id', 'out_product_id', 'merchant_id', 'store_id', 'third_cat_id', 'brand_id', 'status', 'edit_status', 'create_time', 'update_time'], 'integer'],
  49. [['out_product_id'], 'required'],
  50. [['head_img', 'desc_info', 'audit_info', 'qualification_pics', 'scene_group_list', 'delist_info', 'spu_attrs', 'sale_time', 'labels', 'promoter_wechat_numbers', 'cats'], 'safe'],
  51. [['title', 'path', 'reject_reason', 'info_version'], 'string', 'max' => 255],
  52. [['out_product_id'], 'unique'],
  53. ];
  54. }
  55. /**
  56. * {@inheritdoc}
  57. */
  58. public function attributeLabels()
  59. {
  60. return [
  61. 'product_id' => '交易组件平台内部商品ID',
  62. 'out_product_id' => '自定义商品ID',
  63. 'merchant_id' => '商户ID',
  64. 'store_id' => '门店ID',
  65. 'title' => '标题',
  66. 'path' => '路径',
  67. 'head_img' => '主图,多张,列表',
  68. 'desc_info' => '商品详情图文',
  69. 'audit_info' => '修改时间记录',
  70. 'reject_reason' => '审核原因',
  71. 'third_cat_id' => '品类',
  72. 'brand_id' => '品牌',
  73. 'qualification_pics' => '商品资质图片',
  74. 'info_version' => '预留字段,用于版本控制',
  75. 'scene_group_list' => '商品使用场景',
  76. 'delist_info' => 'Delist Info',
  77. 'spu_attrs' => 'Spu Attrs',
  78. 'sale_time' => 'Sale Time',
  79. 'labels' => 'Labels',
  80. 'promoter_wechat_numbers' => 'Promoter Wechat Numbers',
  81. 'cats' => 'Cats',
  82. 'status' => '状态',
  83. 'edit_status' => '审核状态',
  84. 'create_time' => '创建时间',
  85. 'update_time' => '修改时间',
  86. ];
  87. }
  88. /**
  89. * @return \yii\db\ActiveQuery
  90. */
  91. public function getSkus()
  92. {
  93. return $this->hasMany(Sku::class, ['out_product_id' => 'out_product_id']);
  94. }
  95. /**
  96. * @return \yii\db\ActiveQuery
  97. */
  98. public function getCate()
  99. {
  100. return $this->hasOne(Cate::class, ['id' => 'third_cat_id']);
  101. }
  102. }
粤ICP备19079148号