From 5e6725015d9f7dea4df25ab112cebd1efab98e73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 7 Apr 2021 10:24:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gii/GiiController.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Gii/GiiController.php b/Gii/GiiController.php index 62df8f54..131e356c 100644 --- a/Gii/GiiController.php +++ b/Gii/GiiController.php @@ -284,10 +284,10 @@ use {$model_namespace}\\{$managerName}; } $model = ' . $className . '::find()->in(\'id\', $_key); - if(!$model->delete()){ + if (!$model->delete()) { return JSON::to(500, DB_ERROR_BUSY); } - return JSON::to(0, $model); + return JSON::to(0, $_key); }'; } @@ -316,7 +316,7 @@ use {$model_namespace}\\{$managerName}; public function actionDetail(): string { $model = ' . $managerName . '::findOne($this->input->get(\'id\')); - if(empty($model)){ + if (empty($model)) { return JSON::to(404, SELECT_IS_NULL); } return JSON::to(0, $model->toArray()); @@ -353,7 +353,7 @@ use {$model_namespace}\\{$managerName}; if (empty($model)) { return JSON::to(500, SELECT_IS_NULL); } - if(!$model->delete()){ + if (!$model->delete()) { return JSON::to(500, $model->getLastError()); } return JSON::to(0, $model); @@ -388,19 +388,18 @@ use {$model_namespace}\\{$managerName}; //分页处理 $count = $this->input->get(\'count\', -1); $order = $this->input->get(\'order\', \'id\'); - if(!empty($order)) { + if (!empty($order)) { $order .= !$this->input->get(\'isDesc\', 0) ? \' asc\' : \' desc\'; - }else{ + } else { $order = \'id desc\'; } //列表输出 $model = ' . $managerName . '::find()->where($this->input->gets())->orderBy($order); - - if((int) $count === 1){ + if ((int) $count === 1) { $count = $model->count(); } - if($count != -100){ + if ($count != -100) { $model->limit($this->input->offset() ,$this->input->size()); }