TimestampBehavior::class, 'attributes' => [ ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'], ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at' ] ] ]; } /** * {@inheritdoc} */ public function rules() { return [ [['store_id', 'coupon_id'], 'required'], [['store_id', 'event', 'send_times', 'created_at', 'is_delete', 'mch_id', 'updated_at', 'day_num', 'day_count', 'status'], 'integer'], [['coupon_id'],'string'], [['amount', 'money'], 'number'], [['ext_type'], 'safe'], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'Id', 'store_id' => '商城', 'coupon_id' => '优惠券id', 'event' => '触发事件:1=分享,2=购买并付款', 'ext_type' => '附加条款:1=注册,', 'send_times' => '最多发放次数,0表示不限制', 'created_at' => '添加时间', 'is_delete' => '是否删除', 'mch_id' => '入驻商id', 'updated_at' => '更新时间', 'amount' => '现金', 'day_num' => '单人单日获取数量', 'day_count' => '单人总获取量', 'money' => '需要现金', ]; } }