Sku.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace addons\WechatMini\common\models\video\spu;
  3. /**
  4. * This is the model class for table "{{%addon_wechat_mini_video_spu_sku}}".
  5. *
  6. * @property int|null $merchant_id
  7. * @property int|null $store_id 门店ID
  8. * @property int|null $sku_id
  9. * @property int $out_sku_id 商家自定义skuID
  10. * @property int $out_product_id 商家自定义商品ID
  11. * @property string $thumb_img sku小图
  12. * @property float $sale_price 售卖价格
  13. * @property float $market_price 市场价格
  14. * @property int $stock_num 库存
  15. * @property string|null $barcode 条形码
  16. * @property string|null $sku_code 商品编码
  17. * @property string|null $sku_attrs
  18. */
  19. class Sku extends \yii\db\ActiveRecord
  20. {
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public static function tableName()
  25. {
  26. return '{{%addon_wechat_mini_video_spu_sku}}';
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function rules()
  32. {
  33. return [
  34. [['merchant_id', 'store_id', 'sku_id', 'out_sku_id', 'out_product_id', 'stock_num'], 'integer'],
  35. [['out_sku_id', 'thumb_img'], 'required'],
  36. [['sale_price', 'market_price'], 'number'],
  37. [['sku_attrs'], 'safe'],
  38. [['thumb_img'], 'string', 'max' => 255],
  39. [['barcode', 'sku_code'], 'string', 'max' => 100],
  40. [['out_sku_id'], 'unique'],
  41. ];
  42. }
  43. /**
  44. * {@inheritdoc}
  45. */
  46. public function attributeLabels()
  47. {
  48. return [
  49. 'merchant_id' => 'Merchant ID',
  50. 'store_id' => '门店ID',
  51. 'sku_id' => 'Sku ID',
  52. 'out_sku_id' => '商家自定义skuID',
  53. 'out_product_id' => '商家自定义商品ID',
  54. 'thumb_img' => 'sku小图',
  55. 'sale_price' => '售卖价格',
  56. 'market_price' => '市场价格',
  57. 'stock_num' => '库存',
  58. 'barcode' => '条形码',
  59. 'sku_code' => '商品编码',
  60. 'sku_attrs' => 'Sku Attrs',
  61. ];
  62. }
  63. }
粤ICP备19079148号