TimestampBehavior::class, 'attributes' => [ ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'], ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at' ] ] ]; } /** * {@inheritdoc} */ public function rules() { return [ [['store_id', 'card_id', 'account', 'password'], 'required'], [['store_id', 'card_id', 'status'], 'integer'], [['account', 'password'], 'string', 'max' => 60], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'store_id' => 'Store ID', 'card_id' => '卡券id', 'account' => '账号', 'password' => '密码', 'status' => '状态', // 0=未使用,1=已使用 ]; } }