VerifyCard.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. namespace app\models;
  8. use yii\db\ActiveRecord;
  9. use yii\behaviors\TimestampBehavior;
  10. use Yii;
  11. /**
  12. * This is the model class for table "{{%verify_card}}".
  13. *
  14. * @property int $id
  15. * @property int $store_id
  16. * @property string $name 核销卡名称
  17. * @property int $total_num 总次数
  18. * @property int $use_num 核销次数
  19. * @property int $expire_day 有效期
  20. * @property float $money 核销卡单次核销优惠金额
  21. * @property int $price 核销卡价值
  22. * @property string $pic_url 核销卡Logo
  23. * @property int $begin_time 核销卡开始时间
  24. * @property int $end_time 核销卡结束时间
  25. * @property int $created_at 核销卡创建时间
  26. * @property int $sort 排序
  27. * @property int $is_delete 状态
  28. * @property int|null $updated_at 更新时间
  29. * @property int $status 核销卡状态
  30. * @property int $type 核销卡类型
  31. * @property string $bg_pic_url 背景图,
  32. * @property int $date_type 日期类型
  33. * @property int $is_give 是否转赠:0=否,1=是
  34. * @property string $content 卡券说明
  35. * @property int $num 卡券数量
  36. * @property float $total_price 储值卡金额
  37. * @property int $freight_id 运费模板
  38. * @property int $savingsType 储值卡类型
  39. * @property string $goods_ids 商品id
  40. * @property string $video_ids 视频id
  41. * @property string $send_times 发放次数
  42. * @property float $for_cash 礼品卡折现
  43. */
  44. class VerifyCard extends \yii\db\ActiveRecord
  45. {
  46. /**
  47. * {@inheritdoc}
  48. */
  49. public static function tableName()
  50. {
  51. return '{{%verify_card}}';
  52. }
  53. const IS_DELETE_YES = 1;//已删除
  54. const IS_DELETE_NO = 0;//未删除
  55. public function behaviors()
  56. {
  57. return [
  58. [
  59. 'class' => TimestampBehavior::class,
  60. 'attributes' => [
  61. ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'],
  62. ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'
  63. ]
  64. ]
  65. ];
  66. }
  67. /**
  68. * {@inheritdoc}
  69. */
  70. public function rules()
  71. {
  72. return [
  73. [['store_id', 'total_num', 'expire_day', 'created_at', 'is_delete', 'updated_at', 'type', 'status', 'date_type', 'is_give', 'freight_id', 'num', 'savingsType', 'send_times'], 'integer'],
  74. [['name'], 'required'],
  75. [['money', 'price', 'total_price', 'for_cash'], 'double'],
  76. [['use_num', 'begin_time', 'end_time', 'form'], 'safe'],
  77. [['name'], 'string', 'max' => 255],
  78. [['goods_ids', 'video_ids'], 'string'],
  79. [['pic_url', 'bg_pic_url','content'], 'string', 'max' => 2048],
  80. ];
  81. }
  82. /**
  83. * {@inheritdoc}
  84. */
  85. public function attributeLabels()
  86. {
  87. return [
  88. 'id' => 'ID',
  89. 'store_id' => 'Store ID',
  90. 'name' => '核销卡名称',
  91. 'total_num' => '总次数',
  92. 'use_num' => '核销次数',
  93. 'expire_day' => '有效期',
  94. 'money' => '核销卡单次核销优惠金额',
  95. 'price' => '核销卡价值',
  96. 'pic_url' => '核销卡Logo',
  97. 'begin_time' => '核销卡开始时间',
  98. 'end_time' => '核销卡结束时间',
  99. 'created_at' => '核销卡创建时间',
  100. 'sort' => '排序',
  101. 'is_delete' => '状态',
  102. 'updated_at' => '更新时间',
  103. 'status' => '核销卡类型: 1=生效中,2=已失效',
  104. 'type' => '卡券类型:1=核销卡,2=礼品卡,3=储值卡,4=虚拟卡,5=视频卡',
  105. 'bg_pic_url' => '背景图',
  106. 'date_type' => '日期类型',
  107. 'is_give' => '是否转赠:0=否,1=是',
  108. 'content' => '卡券说明',
  109. 'num' => '卡券数量',
  110. 'total_price' => '储值卡金额',
  111. 'freight_id' => '运费模板',
  112. 'savingsType' => '储值卡类型',
  113. 'goods_ids' => '商品id',
  114. 'video_ids' => '视频id',
  115. 'send_times' => '发放次数',
  116. 'for_cash' => '礼品卡折现'
  117. ];
  118. }
  119. }