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