autoGen ID

This commit is contained in:
2020-12-18 11:59:56 +07:00
parent 4d6f1cbed8
commit 27e58bf5e1
5 changed files with 31 additions and 3 deletions

View File

@@ -43,12 +43,23 @@ 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();
$idAuto = $data['data']['box_id'] . "_" . ($last->id + 1);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
'statusArray' => CaptureLogs::$statusArray,
'f' => $f,
't' => $t
't' => $t,
'idAuto' => $idAuto
]);
}

View File

@@ -49,13 +49,24 @@ class ListManagementController extends Controller {
if ($gender !== "all")
$dataProvider->query->andWhere(["gender" => $gender]);
$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();
$idAuto = $data['data']['box_id'] . "_" . ($last->id + 1);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
'f' => $f,
't' => $t,
'typeArray' => ListManagement::$typeArray,
'genderArray' => ListManagement::$genderArray
'genderArray' => ListManagement::$genderArray,
'idAuto' => $idAuto
]);
}