diff --git a/controllers/ApiController.php b/controllers/ApiController.php index 60b5f81a..be3b14fb 100644 --- a/controllers/ApiController.php +++ b/controllers/ApiController.php @@ -420,11 +420,19 @@ class ApiController extends Controller { } public function actionReGenFeature() { - if (Yii::$app->request->isAjax) { - $updating = \app\models\SyncUrl::findOne(['key_config' => 'updating']); + $updating = \app\models\SyncUrl::findOne(['key_config' => 'updating']); + if (!$updating) { + $model = new \app\models\SyncUrl(); + $model->create([ + 'key_config' => "updating", + 'data' => "false" + ]); + } else { $updating->data = "false"; - return $updating->save(); + $updating->save(); } + Yii::$app->response->format = "json"; + return ["data" => "reset updating flag"]; } } diff --git a/views/list-management/index.tpl b/views/list-management/index.tpl index 96cf810b..5dc00695 100644 --- a/views/list-management/index.tpl +++ b/views/list-management/index.tpl @@ -207,11 +207,9 @@ Đặc trưng 2 - - - - + {if $updating->data==="true"} + + {/if} {* {$statistics.512}/{$statistics.img}*}