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' => '礼品卡折现' ]; } }