autoGen ID
This commit is contained in:
@@ -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
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user