WechatVideoShopGoods.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. namespace addons\WechatVideoShop\common\models;
  3. use common\models\goods\Goods;
  4. use Yii;
  5. /**
  6. * This is the model class for table "qimall_addons_wechat_video_shop_goods".
  7. *
  8. * @property int $id
  9. * @property int $mall_id
  10. * @property int $status 状态[1启用 0禁用 -1删除]
  11. * @property int $created_at 创建时间
  12. * @property int $updated_at 更新事件
  13. * @property int $goods_id 商品ID
  14. * @property int $product_id 视频号商品ID
  15. * @property int $listing_status 上下架状态
  16. * @property string $listing_reason 视频号商品ID
  17. * @property array $cate_ids 类目
  18. * @property array $content 完整数据
  19. * @property array $attrs 属性
  20. * @property int $audit_status 审核状态
  21. * @property int $shop_id 审核状态
  22. * @property string $audit_reason 拒绝理由
  23. */
  24. class WechatVideoShopGoods extends \common\models\base\BaseActiveRecord
  25. {
  26. /**
  27. * {@inheritdoc}
  28. */
  29. public static function tableName()
  30. {
  31. return 'qimall_addons_wechat_video_shop_goods';
  32. }
  33. /**
  34. * {@inheritdoc}
  35. */
  36. public function rules()
  37. {
  38. return [
  39. [['mall_id', 'status', 'created_at', 'updated_at', 'goods_id', 'product_id', 'audit_status', 'listing_status', 'shop_id'], 'integer'],
  40. [['cate_ids', 'content', 'attrs'], 'required'],
  41. [['cate_ids', 'content', 'attrs'], 'safe'],
  42. [['audit_reason', 'listing_reason'], 'string', 'max' => 1000],
  43. ];
  44. }
  45. /**
  46. * {@inheritdoc}
  47. */
  48. public function attributeLabels()
  49. {
  50. return [
  51. 'id' => 'ID',
  52. 'mall_id' => 'Mall ID',
  53. 'status' => 'Status',
  54. 'created_at' => 'Created At',
  55. 'updated_at' => 'Updated At',
  56. 'goods_id' => 'Goods ID',
  57. 'product_id' => 'Product ID',
  58. 'cate_ids' => 'Cate Ids',
  59. 'content' => 'Content',
  60. 'attrs' => 'Attrs',
  61. ];
  62. }
  63. public function getShop()
  64. {
  65. return $this->hasOne(WechatVideoShop::class, ['id' => 'shop_id']);
  66. }
  67. public function getGoods()
  68. {
  69. return $this->hasOne(Goods::class, ['id' => 'goods_id']);
  70. }
  71. }