isNewRecord) { $this->created_at = date('Y-m-d H:i:s'); }else{ $this->updated_at = date('Y-m-d H:i:s'); } return true; } return false; } /** * @inheritdoc */ public function rules() { return [ [['id','f_cat_id', 'cat_id','is_show','brand_qua_id','qua_id','level','leaf'], 'integer'], [['name'], 'string'], [['created_at','updated_at'], 'safe'], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', ]; } }