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', 'question', 'is_hot', 'cat_id'], 'required'], [['store_id', 'name', 'question', 'created_at', 'is_delete', 'updated_at', 'state'], 'safe'] ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'store_id' => 'Store ID', 'cat_id' => '分类id', 'name' => '名称', 'question' => '问题', 'is_hot' => '是否热门', 'created_at' => '添加时间', 'is_delete' => '是否删除', 'updated_at' => 'Update Time', ]; } }