TimestampBehavior::class, 'attributes' => [ ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'], ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at' ] ] ]; } /** * {@inheritdoc} */ public function rules() { return [ [['store_id', 'name'], 'required'], [['store_id', 'discount_type', 'updated_at', 'expire_type', 'expire_day', 'begin_time', 'end_time', 'created_at', 'is_delete', 'total_count', 'is_join', 'sort', 'appoint_type', 'is_integral', 'integral', 'total_num', 'user_num', 'mch_id', 'is_join_welfare', 'is_give','is_business','business_type','is_alipay_voucher'], 'integer'], [['min_price', 'sub_price', 'discount', 'price'], 'number'], [['name', 'cat_id_list', 'goods_id_list'], 'string', 'max' => 255], [['desc'], 'string', 'max' => 2000], [['pic_url'], 'string', 'max' => 2048], [['rule'], 'string', 'max' => 1000], ['discount', 'default', 'value' => 10], ['is_integral', 'default', 'value' => 1], ['integral', 'default', 'value' => 0], ['price', 'default', 'value' => 0], ['total_num', 'default', 'value' => 0], ['expire_day', 'default', 'value' => 0], ['user_num', 'default', 'value' => 0], ['sub_price', 'default', 'value' => 0], ['total_count', 'default', 'value' => -1], [['begin_time', 'end_time'], 'default', 'value' => 0], [['is_alipay_voucher', 'mini_id', 'publish_start_time', 'publish_end_time', 'alipay_activity_id', 'status'], 'safe'] ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'store_id' => 'Store ID', 'name' => '优惠券名称', 'desc' => '优惠券描述', 'pic_url' => '缩略图', 'discount_type' => '优惠券类型:1=折扣,2=满减', 'min_price' => '最低消费金额', 'sub_price' => '优惠金额', 'discount' => '折扣率', 'expire_type' => '到期类型:1=领取后N天过期,2=指定有效期', 'expire_day' => '有效天数,expire_type=1时', 'begin_time' => '有效期开始时间', 'end_time' => '有效期结束时间', 'created_at' => '添加时间', 'is_delete' => '是否删除', 'total_count' => '发放总数量', 'is_join' => '是否加入领券中心 1--不加入领券中心 2--加入领券中心', 'sort' => '排序按降序排列', 'cat_id_list' => 'Cat Id List', 'appoint_type' => 'Appoint Type', 'is_integral' => '是否加入积分商城 1--不加入 2--加入', 'integral' => '兑换需要积分数量', 'price' => '售价', 'total_num' => '积分商城发放总数', 'user_num' => '每人限制兑换数量', 'rule' => '使用说明', 'goods_id_list' => 'Goods Id List', 'mch_id' => '入驻商id', 'updated_at' => 'Update Time', 'is_join_welfare' => '是否加入福利中心 1--不加入福利中心 2--加入福利中心', 'is_give' => '是否可转增', 'is_business' => '是否是商盟', 'business_type' => '展示位置', ]; } }