This commit is contained in:
2021-01-13 18:11:51 +07:00
parent aa811a40dd
commit 5472f6ef77
2 changed files with 27 additions and 11 deletions

View File

@@ -236,6 +236,14 @@ class ApiController extends Controller {
public function actionAutoGenFeature() {
Yii::$app->response->format = "json";
$updating = \app\models\SyncUrl::findOne(['key_config' => 'updating']);
if (!$updating) {
$model = new \app\models\SyncUrl();
$model->create([
'key_config' => "updating",
'data' => "false"
]);
$updating = \app\models\SyncUrl::findOne(['key_config' => 'updating']);
}
if ($updating->data === "true") {
$txt = "\n" . date("H:i:s d/m/Y") . " " . "updating";
file_put_contents(date('Ymd') . "_logs.txt", $txt, FILE_APPEND);