| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use yii\db\ActiveRecord;
- use yii\behaviors\TimestampBehavior;
- use Yii;
- /**
- * This is the model class for table "{{%verify_card}}".
- *
- * @property int $id
- * @property int $store_id
- * @property string $name 核销卡名称
- * @property int $total_num 总次数
- * @property int $use_num 核销次数
- * @property int $expire_day 有效期
- * @property float $money 核销卡单次核销优惠金额
- * @property int $price 核销卡价值
- * @property string $pic_url 核销卡Logo
- * @property int $begin_time 核销卡开始时间
- * @property int $end_time 核销卡结束时间
- * @property int $created_at 核销卡创建时间
- * @property int $sort 排序
- * @property int $is_delete 状态
- * @property int|null $updated_at 更新时间
- * @property int $status 核销卡状态
- * @property int $type 核销卡类型
- * @property string $bg_pic_url 背景图,
- * @property int $date_type 日期类型
- * @property int $is_give 是否转赠:0=否,1=是
- * @property string $content 卡券说明
- * @property int $num 卡券数量
- * @property float $total_price 储值卡金额
- * @property int $freight_id 运费模板
- * @property int $savingsType 储值卡类型
- * @property string $goods_ids 商品id
- * @property string $video_ids 视频id
- * @property string $send_times 发放次数
- * @property float $for_cash 礼品卡折现
- */
- class VerifyCard extends \yii\db\ActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%verify_card}}';
- }
- const IS_DELETE_YES = 1;//已删除
- const IS_DELETE_NO = 0;//未删除
- public function behaviors()
- {
- return [
- [
- 'class' => TimestampBehavior::class,
- 'attributes' => [
- ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'],
- ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'
- ]
- ]
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['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'],
- [['name'], 'required'],
- [['money', 'price', 'total_price', 'for_cash'], 'double'],
- [['use_num', 'begin_time', 'end_time', 'form'], 'safe'],
- [['name'], 'string', 'max' => 255],
- [['goods_ids', 'video_ids'], 'string'],
- [['pic_url', 'bg_pic_url','content'], 'string', 'max' => 2048],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'store_id' => 'Store ID',
- 'name' => '核销卡名称',
- 'total_num' => '总次数',
- 'use_num' => '核销次数',
- 'expire_day' => '有效期',
- 'money' => '核销卡单次核销优惠金额',
- 'price' => '核销卡价值',
- 'pic_url' => '核销卡Logo',
- 'begin_time' => '核销卡开始时间',
- 'end_time' => '核销卡结束时间',
- 'created_at' => '核销卡创建时间',
- 'sort' => '排序',
- 'is_delete' => '状态',
- 'updated_at' => '更新时间',
- 'status' => '核销卡类型: 1=生效中,2=已失效',
- 'type' => '卡券类型:1=核销卡,2=礼品卡,3=储值卡,4=虚拟卡,5=视频卡',
- 'bg_pic_url' => '背景图',
- 'date_type' => '日期类型',
- 'is_give' => '是否转赠:0=否,1=是',
- 'content' => '卡券说明',
- 'num' => '卡券数量',
- 'total_price' => '储值卡金额',
- 'freight_id' => '运费模板',
- 'savingsType' => '储值卡类型',
- 'goods_ids' => '商品id',
- 'video_ids' => '视频id',
- 'send_times' => '发放次数',
- 'for_cash' => '礼品卡折现'
- ];
- }
- }
|