them filters trong form dong bo

This commit is contained in:
2020-12-29 15:35:04 +07:00
parent cb6c8fba32
commit d296533184
5 changed files with 88 additions and 10 deletions

View File

@@ -401,11 +401,16 @@ class ListManagementController extends Controller {
])
]
])), true);
$filters = [];
foreach ($datas['data'] as $key => $value) {
$filters[$value['code']] = $value['code'] . " - " . $value['name'] . " - " . $value['department'];
}
Yii::$app->response->format = "json";
return [
"title" => "<i class='fa fa-download'></i> Đồng bộ từ máy chủ",
"form" => $this->renderPartial("list-server", [
"datas" => $datas['data'],
"filters" => $filters,
"allID" => ListManagement::getAllID()
])
];
@@ -633,10 +638,16 @@ class ListManagementController extends Controller {
public function actionSyncToServer() {
if (Yii::$app->request->isAjax) {
Yii::$app->response->format = "json";
$datas = ListManagement::find()->orderBy(["code" => SORT_ASC])->all();
$filters = [];
foreach ($datas as $key => $value) {
$filters[$value->code] = $value->code . " - " . $value->name . " - " . $value->address;
}
return [
"title" => "<i class='fa fa-upload'></i> Đồng bộ lên máy chủ",
"form" => $this->renderPartial("list-to-server", [
"datas" => ListManagement::find()->orderBy(["code" => SORT_ASC])->all()
"datas" => $datas,
"filters" => $filters
])
];
}