xhGoods.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  2. namespace common\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "xhGoods".
  6. *
  7. * @property int $id
  8. * @property string $goodsName 商品名称
  9. * @property string $itemNumber 商品编号
  10. * @property string $cover 封面
  11. * @property string $shopImg 商品图片列表
  12. * @property int $stock 库存
  13. * @property string $price 价格
  14. * @property int $userId 创建商品的用户id
  15. * @property int $adminId 创建商品的管理员id
  16. * @property int $merchantId 商户id
  17. * @property string $categoryId 分类id列表
  18. * @property string $representative 花语,代表意义
  19. * @property string $sendArea 配送范围
  20. * @property int $isCharge 是否收取快递费,1:收取(默认);0:不收取
  21. * @property int $sold 已售出,商家自定义的销售量
  22. * @property int $actualSold 实际的销售量,对外展示的销售将是sold + actualSold
  23. * @property string $material 花材,鲜花主花材
  24. * @property int $flowerNum 多少朵
  25. * @property int $fitPeople 适用人群,爱人老师客户领导/长辈朋友/同事病人
  26. * @property int $fitFestival 适用节日,情人节圣诞节春节元旦3.8妇女节清明母亲节父亲节感恩节教师节中秋节七夕其他白色情人节建军节
  27. * @property string $content 正文内容
  28. * @property int $style 商品类型 0普通商品
  29. * @property int $riseAmount 商品单独定义涨价金额或百分比数,涨价方式riseType参考xhGoodsSetting表
  30. * @property int $inTurn 排序
  31. * @property int $delStatus 删除状态 0正常,没有删除 1删除
  32. * @property int $status 商品状态 0正常1下架2删除
  33. * @property string $createTime 创建时间
  34. * @property string $updateTime
  35. * @property string $urlQrCode 商品链接二维码地址
  36. * @property string $shortUrl 商品短链接地址
  37. * @property string $multiPrice 多种价格id 例(1,2,3,4)
  38. */
  39. class xhGoods extends xhBaseModel
  40. {
  41. /**
  42. * @inheritdoc
  43. */
  44. public static function tableName()
  45. {
  46. return 'xhGoods';
  47. }
  48. /**
  49. * @inheritdoc
  50. */
  51. public function rules()
  52. {
  53. return [
  54. [['stock', 'userId', 'adminId', 'merchantId', 'isCharge', 'sold', 'actualSold', 'flowerNum', 'fitPeople', 'fitFestival', 'style', 'riseAmount', 'inTurn', 'delStatus', 'status'], 'integer'],
  55. [['price'], 'number'],
  56. [['content', 'createTime'], 'required'],
  57. [['content'], 'string'],
  58. [['createTime', 'updateTime'], 'safe'],
  59. [['goodsName', 'categoryId'], 'string', 'max' => 100],
  60. [['itemNumber'], 'string', 'max' => 50],
  61. [['cover', 'urlQrCode'], 'string', 'max' => 200],
  62. [['shopImg'], 'string', 'max' => 800],
  63. [['representative', 'sendArea', 'material', 'shortUrl'], 'string', 'max' => 500],
  64. [['multiPrice'], 'string', 'max' => 255],
  65. [['itemNumber'], 'unique'],
  66. ];
  67. }
  68. /**
  69. * @inheritdoc
  70. */
  71. public function attributeLabels()
  72. {
  73. return [
  74. 'id' => 'ID',
  75. 'goodsName' => 'Goods Name',
  76. 'itemNumber' => 'Item Number',
  77. 'cover' => 'Cover',
  78. 'shopImg' => 'Shop Img',
  79. 'stock' => 'Stock',
  80. 'price' => 'Price',
  81. 'userId' => 'User ID',
  82. 'adminId' => 'Admin ID',
  83. 'merchantId' => 'Merchant ID',
  84. 'categoryId' => 'Category ID',
  85. 'representative' => 'Representative',
  86. 'sendArea' => 'Send Area',
  87. 'isCharge' => 'Is Charge',
  88. 'sold' => 'Sold',
  89. 'actualSold' => 'Actual Sold',
  90. 'material' => 'Material',
  91. 'flowerNum' => 'Flower Num',
  92. 'fitPeople' => 'Fit People',
  93. 'fitFestival' => 'Fit Festival',
  94. 'content' => 'Content',
  95. 'style' => 'Style',
  96. 'riseAmount' => 'Rise Amount',
  97. 'inTurn' => 'In Turn',
  98. 'delStatus' => 'Del Status',
  99. 'status' => 'Status',
  100. 'createTime' => 'Create Time',
  101. 'updateTime' => 'Update Time',
  102. 'urlQrCode' => 'Url Qr Code',
  103. 'shortUrl' => 'Short Url',
  104. 'multiPrice' => 'Multi Price',
  105. ];
  106. }
  107. }