update autocomplete choose staff

This commit is contained in:
2020-12-21 16:57:30 +07:00
parent 5bb7d519fc
commit df644d539d
9 changed files with 133 additions and 40 deletions

View File

@@ -8,6 +8,7 @@ use app\models\CaptureLogsSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use app\models\ListManagement;
/**
* CaptureLogsController implements the CRUD actions for CaptureLogs model.
@@ -43,17 +44,17 @@ class CaptureLogsController extends Controller {
$dataProvider->query->andWhere(["BETWEEN", "capture_logs.time", $f, $t]);
$dataProvider->query->orderBy(["time" => SORT_DESC]);
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create([
'http' => [
'header' => "Content-Type: application/json",
'method' => "POST"
]
])), true);
$data = json_decode($tempConfig['data'], true);
$last = \app\models\ListManagement::find()->orderBy(['id' => SORT_DESC])->limit(1)->one();
if (!is_object($last))
$last = (object) ['id' => 0];
$idAuto = $data['data']['box_id'] . "_" . ($last->id + 1);
// $tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create([
// 'http' => [
// 'header' => "Content-Type: application/json",
// 'method' => "POST"
// ]
// ])), true);
// $data = json_decode($tempConfig['data'], true);
// $last = \app\models\ListManagement::find()->orderBy(['id' => SORT_DESC])->limit(1)->one();
// if (!is_object($last))
// $last = (object) ['id' => 0];
// $idAuto = $data['data']['box_id'] . "_" . ($last->id + 1);
return $this->render('index', [
'searchModel' => $searchModel,
@@ -61,7 +62,8 @@ class CaptureLogsController extends Controller {
'statusArray' => CaptureLogs::$statusArray,
'f' => $f,
't' => $t,
'idAuto' => $idAuto
// 'idAuto' => $idAuto,
"staffArray" => ListManagement::staffArray()
]);
}