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'];
$config_json = [];
foreach ($cfgData as $key => $value) {
if (is_numeric($value['data'])) {
$value['data'] = floatval($value['data']);
}
// if (is_numeric($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']);
if (count($pr) == 1) {

View File

@ -143,7 +143,7 @@ class ListManagementController extends Controller {
"birthday" => date("d/m/Y", $ListManagement->birthday),
"telephone" => $ListManagement->telephone,
"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,6 +76,7 @@ class CaptureLogsGrid {
$staff = $model->listManagement;
if ($staff) {
$images = json_decode($staff->image, true);
if (count($images) > 0)
return Html::img("/data/uploads/face/" . $images[0]['url'], [
"class" => "img-thumbnail",
"style" => "width: 150px;height:150px;"