fix bug config

This commit is contained in:
dongpd 2020-12-14 14:18:50 +07:00
parent 237f658e16
commit 8530a33542
3 changed files with 12 additions and 8 deletions

View File

@ -207,9 +207,12 @@ class ConfigController extends Controller {
$cfgData = $post['config']; $cfgData = $post['config'];
$config_json = []; $config_json = [];
foreach ($cfgData as $key => $value) { foreach ($cfgData as $key => $value) {
if (is_numeric($value['data'])) { // if (is_numeric($value['data'])) {
$value['data'] = floatval($value['data']); // $value['data'] = floatval($value['data']);
} // }
$value['data'] = trim(strip_tags($value['data']));
$value['data'] = str_replace(' ', '', $value['data']);
$value['data'] = preg_replace('/\s+/', ' ', $value['data']);
$pr = explode("|", $value['parent']); $pr = explode("|", $value['parent']);
if (count($pr) == 1) { if (count($pr) == 1) {

View File

@ -143,7 +143,7 @@ class ListManagementController extends Controller {
"birthday" => date("d/m/Y", $ListManagement->birthday), "birthday" => date("d/m/Y", $ListManagement->birthday),
"telephone" => $ListManagement->telephone, "telephone" => $ListManagement->telephone,
"address" => $ListManagement->address, "address" => $ListManagement->address,
"image" => "/data/uploads/face/" . $images[0]['url'] "image" => count($images) > 0 ? "/data/uploads/face/" . $images[0]['url'] : "/images/user2-160x160.jpg"
]; ];
} }
} }

View File

@ -76,10 +76,11 @@ class CaptureLogsGrid {
$staff = $model->listManagement; $staff = $model->listManagement;
if ($staff) { if ($staff) {
$images = json_decode($staff->image, true); $images = json_decode($staff->image, true);
return Html::img("/data/uploads/face/" . $images[0]['url'], [ if (count($images) > 0)
"class" => "img-thumbnail", return Html::img("/data/uploads/face/" . $images[0]['url'], [
"style" => "width: 150px;height:150px;" "class" => "img-thumbnail",
]); "style" => "width: 150px;height:150px;"
]);
} }
return ""; return "";
}; };