PtActivityGoods.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. namespace app\models;
  8. use yii\behaviors\TimestampBehavior;
  9. use yii\db\ActiveRecord;
  10. /**
  11. * This is the model class for table "{{%pt_activity_goods}}".
  12. *
  13. * @property integer $id
  14. * @property integer $goods_id
  15. * @property string $attr
  16. * @property integer $virtual_sales
  17. * @property float $pt_price
  18. * @property integer $store_id
  19. * @property integer $is_delete
  20. * @property integer $activity_id
  21. * @property integer $created_at
  22. * @property integer $updated_at
  23. * @property integer $use_attr
  24. * @property integer $sale_num
  25. * @property integer $cat_id
  26. */
  27. class PtActivityGoods extends \yii\db\ActiveRecord
  28. {
  29. /**
  30. * @inheritdoc
  31. */
  32. public static function tableName()
  33. {
  34. return '{{%pt_activity_goods}}';
  35. }
  36. public function behaviors()
  37. {
  38. return [
  39. [
  40. 'class' => TimestampBehavior::class,
  41. 'attributes' => [
  42. ActiveRecord::EVENT_BEFORE_INSERT => ['created_at'],
  43. ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at']
  44. ]
  45. ]
  46. ];
  47. }
  48. /**
  49. * @inheritdoc
  50. */
  51. public function rules()
  52. {
  53. return [
  54. [['id', 'goods_id', 'virtual_sales', 'store_id', 'is_delete', 'activity_id', 'cat_id', 'use_attr'], 'integer'],
  55. [['attr'], 'string'],
  56. [['sale_num', 'pt_price'], 'number'],
  57. [['created_at', 'updated_at'], 'safe']
  58. ];
  59. }
  60. /**
  61. * @inheritdoc
  62. */
  63. public function attributeLabels()
  64. {
  65. return [
  66. 'id' => '',
  67. 'goods_id' => '商品id',
  68. 'attr' => '商品规格',
  69. 'virtual_sales' => '虚拟销量',
  70. 'pt_price' => '拼团价格',
  71. 'store_id' => 'Store ID',
  72. 'is_delete' => 'IS Delete',
  73. 'activity_id' => '活动id',
  74. 'created_at' => '',
  75. 'updated_at' => '',
  76. 'use_attr' => '是否使用规格',
  77. 'sale_num' => '售卖数量',
  78. 'cat_id' => '分类ID'
  79. ];
  80. }
  81. }