VideoShopGoodsExt.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. namespace app\models;
  3. use yii\behaviors\TimestampBehavior;
  4. /**
  5. * This is the model class for table "{{%video_shop_goods_ext}}".
  6. *
  7. * @property integer $id
  8. * @property string $product_id
  9. * @property integer $goods_id
  10. * @property integer $store_id
  11. * @property integer $mini_id
  12. * @property integer $status
  13. * @property integer $is_delete
  14. * @property string $created_at
  15. * @property string $updated_at
  16. * @property integer $wx_status
  17. * @property integer $wx_edit_status
  18. * @property string $wx_status_reason
  19. * @property integer $wx_product_info
  20. */
  21. class VideoShopGoodsExt extends \yii\db\ActiveRecord
  22. {
  23. public static function wx_status_name($status = 0){
  24. $arr = [
  25. 0 => '初始值',
  26. 5 => '上架',
  27. 6 => '回收站',
  28. 11 => '自主下架',
  29. 13 => '违规下架/风控系统下架',
  30. 14 => '保证金不足下架',
  31. 15 => '品牌过期下架',
  32. 20 => '商品被封禁',
  33. ];
  34. return isset($status) ? $arr[$status] : $arr;
  35. }
  36. public static function wx_edit_status_name($status = 0){
  37. $arr = [
  38. 0=>'初始值',
  39. 1=>'编辑中',
  40. 2=>'审核中',
  41. 3=>'审核失败',
  42. 4=>'审核成功',
  43. 7=>'商品异步提交,上传中(处于该状态的商品调用上架商品接口会返回10020067)',
  44. 8=>'商品异步提交,上传失败(请重新提交)',
  45. ];
  46. return isset($status) ? $arr[$status] : $arr;
  47. }
  48. /**
  49. * @inheritdoc
  50. */
  51. public static function tableName()
  52. {
  53. return '{{%video_shop_goods_ext}}';
  54. }
  55. /**
  56. * @inheritdoc
  57. */
  58. public function rules()
  59. {
  60. return [
  61. [['id', 'goods_id', 'is_delete', 'store_id', 'mini_id', 'status', 'wx_status', 'wx_edit_status'], 'integer'],
  62. [['product_id'], 'string'],
  63. [['created_at', 'updated_at', 'wx_product_info', 'wx_status_reason'], 'safe']
  64. ];
  65. }
  66. public function behaviors()
  67. {
  68. return [
  69. [
  70. 'class' => TimestampBehavior::class,
  71. ]
  72. ];
  73. }
  74. /**
  75. * @inheritdoc
  76. */
  77. public function attributeLabels()
  78. {
  79. return [
  80. "id" => "",
  81. "product_id" => "商品id",
  82. "goods_id" => "商品id",
  83. 'mini_id' => '',
  84. 'status' => '',
  85. 'wx_status' => '商品线上状态',
  86. "is_delete" => "",
  87. "created_at" => "",
  88. "updated_at" => "",
  89. "store_id" => ""
  90. ];
  91. }
  92. }