/** * 修改分类 */ public function actionModify() { $identity = Identity::checkIdentity('modify', '/app-backend/backend/category/modify'); if (is_array($identity)) { return $identity; } $data = []; $res = ['code' => 3, 'msg' => 'data erorr']; $data['categoryName'] = \Yii::$app->request->_get('categoryName', ''); $data['categoryDescript'] = \Yii::$app->request->_get('categoryDescript', ''); $data['icon'] = \Yii::$app->request->_get('categoryIcon', ''); $data['id'] = \Yii::$app->request->_get('id', ''); if (intval($data['id']) && Category::modifyCategory($data)) { $res = ['code' => 0, 'msg' => 'ok']; } return $res; }