diff --git a/app/common/service/UsedCarService.php b/app/common/service/UsedCarService.php index 0e44fd0..bffec12 100644 --- a/app/common/service/UsedCarService.php +++ b/app/common/service/UsedCarService.php @@ -94,7 +94,11 @@ class UsedCarService if(empty($data['price'])){ $data['price'] = 0; } - $data['attachment'] = json_encode($data['attachment']); + if(!empty($data['attachment'])){ + $data['attachment'] = json_encode($data['attachment']); + }else{ + $data['attachment'] = ''; + } $data['user_id'] = $request->user['id']; return $data; }