fix bug updating flag
This commit is contained in:
parent
74135e96de
commit
5cefdb8031
|
@ -420,11 +420,19 @@ class ApiController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionReGenFeature() {
|
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";
|
$updating->data = "false";
|
||||||
return $updating->save();
|
$updating->save();
|
||||||
}
|
}
|
||||||
|
Yii::$app->response->format = "json";
|
||||||
|
return ["data" => "reset updating flag"];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,11 +207,9 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
Đặc trưng 2
|
Đặc trưng 2
|
||||||
<label class="label label-danger {if $updating->data==="false"}hidden{/if}" id="updating-label">Đang cập nhật ...</label>
|
{if $updating->data==="true"}
|
||||||
<a href="{Url::to(['/api/re-gen-feature'])}" class="{if $updating->data==="true"}hidden{/if}" onclick="reGenFeature(this);
|
<label class="label label-danger" id="updating-label">Đang cập nhật ...</label>
|
||||||
return false;" data-toggle="tooltip" title="Cập nhật lại đặc trưng">
|
{/if}
|
||||||
<i class="fa fa-refresh"></i>
|
|
||||||
</a>
|
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right" id="total512">
|
<td class="text-right" id="total512">
|
||||||
{* <b class="text-red">{$statistics.512}</b>/<b>{$statistics.img}</b>*}
|
{* <b class="text-red">{$statistics.512}</b>/<b>{$statistics.img}</b>*}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user