Compare commits

...

2 Commits

Author SHA1 Message Date
dongpd
aa28d09d93 fix bug + thêm mẫu người mới trên thiết bị 2025-09-25 21:13:56 +07:00
9960469007 Update controllers/ApiController.php 2024-11-22 02:03:33 +00:00
6 changed files with 80 additions and 46 deletions

View File

@ -518,6 +518,7 @@ class ApiController extends Controller {
}
public function actionReGenFeature() {
@file_get_contents("http://localhost:2305/update-feature");
\app\models\SyncUrl::deleteAll(['key_config' => 'log_process_status']);
$updating = \app\models\SyncUrl::findOne(['key_config' => 'updating']);
if (!$updating) {

View File

@ -14,9 +14,21 @@ class ConfigController extends Controller {
public function init() {
parent::init();
}
public function beforeAction($action) {
if (!parent::beforeAction($action)) {
return false;
}
Yii::$app->language = Yii::$app->session->get("language") ? Yii::$app->session->get("language")["name"] : Yii::$app->language;
if (Yii::$app->user->isGuest)
return $this->redirect(['/site/login']);
if (Yii::$app->user->isGuest) {
$this->redirect(['/site/login']);
return false;
}
return true;
}
/**
@ -759,5 +771,4 @@ class ConfigController extends Controller {
return true;
}
}
}

View File

@ -705,12 +705,12 @@ class ListManagementController extends Controller {
$staff = ListManagement::findOne(['id' => $post['code']]);
Yii::$app->response->format = "json";
return [
"name" => $staff->name,
"gender" => $staff->gender,
"birthday" => date("d/m/Y", $staff->birthday),
"telephone" => $staff->telephone,
"department" => $staff->address,
"abbreviated_name" => $staff->abbreviated_name
"name" => $staff ? $staff->name : "",
"gender" => $staff ? $staff->gender : "",
"birthday" => $staff ? date("d/m/Y", $staff->birthday) : "",
"telephone" => $staff ? $staff->telephone : "",
"department" => $staff ? $staff->address : "",
"abbreviated_name" => $staff ? $staff->abbreviated_name : ""
];
}
}
@ -926,5 +926,4 @@ class ListManagementController extends Controller {
];
}
}
}

View File

@ -1,7 +1,7 @@
copy.src.files=false
copy.src.on.open=false
copy.src.target=
remote.connection=BiFace-99bab6
remote.connection=tungbt-c365ac
remote.directory=/BiFace_Server_Lite
remote.upload=ON_SAVE
run.as=REMOTE

View File

@ -49,7 +49,7 @@
'format' => "raw",
'contentOptions' => ['class' => 'text-center'],
'headerOptions' => ['class' => 'text-center'],
'value' => \app\helpers\CaptureLogsGrid::image()
'value' => \app\helpers\CaptureLogsGrid::image(true)
],
[
'attribute' => 'confidence',

View File

@ -1,7 +1,24 @@
$(function () {
common.dateTimePickerByClass("datepicker", "HH:mm DD/MM/YYYY");
common.dateTimePickerDay("birthday");
$("#Code").select2();
$("#Code").select2({
tags: true,
createTag: function (params) {
return {
id: params.term,
text: params.term,
newOption: true
};
},
templateResult: function (data) {
var $result = $("<span></span>");
$result.text(data.text);
if (data.newOption) {
$result.append(" <em>(Thêm mới)</em>");
}
return $result;
}
});
$("input[name='AllData']").change(function () {
if ($('input[name=AllData]').is(':checked')) {
window.location = $("input[name='URL']").val() + "?all=true" + "&from=" + $("input[name='From']").val() + "&to=" + $("input[name='To']").val();
@ -26,6 +43,12 @@ function _form(e) {
var confidence = JSON.parse($(e).attr("data-confidence"));
$("#closest-img").attr("src", confidence.img != "" ? confidence.img : "/images/user2-160x160.jpg");
$("#closest-name").html(confidence.name + " [" + confidence.score + "]");
clearData();
}
function clearData() {
$('#Code').val("").trigger('change');
}
function _close() {