Compare commits

..

1 Commits

Author SHA1 Message Date
b3bca79f55 fix bug confidence 2021-06-17 17:42:56 +07:00

View File

@ -97,7 +97,7 @@ class CaptureLogsGrid {
public static function rows() { public static function rows() {
return function($model, $index, $widget, $grid) { return function($model, $index, $widget, $grid) {
$confidence = json_decode($model->confidence, true); $confidence = json_decode($model->confidence, true);
$person = \app\models\ListManagement::findOne($confidence['id1']); $person = isset($confidence['id1']) ? \app\models\ListManagement::findOne($confidence['id1']) : false;
$images = false; $images = false;
if ($person) { if ($person) {
$images = json_decode($person->image, true); $images = json_decode($person->image, true);
@ -110,7 +110,7 @@ class CaptureLogsGrid {
"img" => "/data/uploads/face/" . $model->image, "img" => "/data/uploads/face/" . $model->image,
"confidence" => json_encode([ "confidence" => json_encode([
"name" => $person ? $person->name : "", "name" => $person ? $person->name : "",
"score" => $confidence['percent1'], "score" => isset($confidence['percent1']) ? $confidence['percent1'] : "",
"img" => isset($images[0]) ? "/data/uploads/face/" . $images[0]['url'] : "" "img" => isset($images[0]) ? "/data/uploads/face/" . $images[0]['url'] : ""
]) ])
] ]