fix bug updating flag

This commit is contained in:
2021-01-19 14:58:18 +07:00
parent 74135e96de
commit 5cefdb8031
2 changed files with 14 additions and 8 deletions

View File

@@ -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"];
}
}