TimestampBehavior::class, 'attributes' => [ ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'], ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at' ] ] ]; } /** * {@inheritdoc} */ public function rules() { return [ [['name', 'store_id', 'sort', 'state'], 'required'], [['store_id', 'name', 'created_at', 'is_delete', 'updated_at'], 'safe'] ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'store_id' => 'Store ID', 'name' => '名称', 'created_at' => '添加时间', 'is_delete' => '是否删除', 'updated_at' => 'Update Time', ]; } }