Goods.php 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. namespace addons\WechatMini\common\models\live;
  3. use Yii;
  4. /**
  5. * This is the model class for table "{{%addon_wechat_mini_live_goods}}".
  6. *
  7. * @property int $id id
  8. * @property int|null $merchant_id 商户id
  9. * @property string|null $name 商品名称
  10. * @property string|null $cover_img 商品封面图链接
  11. * @property string|null $cover_media 商品封面资源ID
  12. * @property string|null $url 商品小程序路径
  13. * @property float|null $price 商品价格(分)
  14. * @property float|null $price_two 商品价格,使用方式看price_type
  15. * @property int|null $price_type 价格类型,1:一口价(只需要传入price,price2不传) 2:价格区间(price字段为左边界,price2字段为右边界,price和price2必传) 3:显示折扣价(price字段为原价,price2字段为现价, price和price2必传)
  16. * @property int|null $goods_id 商品id
  17. * @property string|null $explain_url 商品讲解视频
  18. * @property string|null $third_party_appid 第三方商品appid ,当前小程序商品则为空
  19. * @property int|null $third_party_tag 1、2:表示是为 API 添加商品,否则是直播控制台添加的商品
  20. * @property int|null $audit_status 0:未审核,1:审核中,2:审核通过,3审核失败
  21. * @property int $status 状态[-1:删除;0:禁用;1启用]
  22. * @property int|null $created_at 创建时间
  23. * @property int|null $updated_at 修改时间
  24. */
  25. class Goods extends \yii\db\ActiveRecord
  26. {
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public static function tableName()
  31. {
  32. return '{{%addon_wechat_mini_live_goods}}';
  33. }
  34. /**
  35. * {@inheritdoc}
  36. */
  37. public function rules()
  38. {
  39. return [
  40. [['merchant_id', 'price_type', 'goods_id', 'third_party_tag', 'audit_status', 'status', 'created_at', 'updated_at'], 'integer'],
  41. [['price', 'price_two'], 'number'],
  42. [['name', 'cover_img', 'url', 'explain_url'], 'string', 'max' => 255],
  43. [['cover_media'], 'string', 'max' => 200],
  44. [['third_party_appid'], 'string', 'max' => 50],
  45. ];
  46. }
  47. /**
  48. * {@inheritdoc}
  49. */
  50. public function attributeLabels()
  51. {
  52. return [
  53. 'id' => 'id',
  54. 'merchant_id' => '商户id',
  55. 'name' => '商品名称',
  56. 'cover_img' => '商品封面图链接',
  57. 'cover_media' => '商品封面资源ID',
  58. 'url' => '商品小程序路径',
  59. 'price' => '商品价格(分)',
  60. 'price_two' => '商品价格,使用方式看price_type',
  61. 'price_type' => '价格类型,1:一口价(只需要传入price,price2不传) 2:价格区间(price字段为左边界,price2字段为右边界,price和price2必传) 3:显示折扣价(price字段为原价,price2字段为现价, price和price2必传)',
  62. 'goods_id' => '商品id',
  63. 'explain_url' => '商品讲解视频',
  64. 'third_party_appid' => '第三方商品appid ,当前小程序商品则为空',
  65. 'third_party_tag' => '1、2:表示是为 API 添加商品,否则是直播控制台添加的商品',
  66. 'audit_status' => '0:未审核,1:审核中,2:审核通过,3审核失败',
  67. 'status' => '状态[-1:删除;0:禁用;1启用]',
  68. 'created_at' => '创建时间',
  69. 'updated_at' => '修改时间',
  70. ];
  71. }
  72. }
粤ICP备19079148号