TimestampBehavior::class, 'attributes' => [ ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'], ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at' ] ] ]; } /** * {@inheritdoc} */ public function rules() { return [ [['store_id', 'is_delete', 'updated_at', 'created_at'], 'integer'], [['name', 'pic_url', 'is_delete'], 'required'], [['content'], 'string'], [['name'], 'string', 'max' => 255], [['pic_url'], 'string', 'max' => 2048], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'store_id' => 'Store ID', 'name' => '卡券名称', 'pic_url' => 'Pic Url', 'content' => '卡券描述', 'is_delete' => 'Is Delete', 'updated_at' => 'Update Time', 'created_at' => 'Add Time', ]; } }