fix bug updating flag
This commit is contained in:
@@ -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"];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user