Merge pull request 'update notify' (#54) from zhangwei into dev

Reviewed-on: #54
This commit is contained in:
weiz 2023-09-09 20:32:48 +08:00
commit b3648c544b

View File

@ -164,7 +164,7 @@ class IndexController extends BaseApiController
$cars = json_decode($contract['cars_info'], true); $cars = json_decode($contract['cars_info'], true);
$data = []; $data = [];
foreach ($cars as $k => $v) { foreach ($cars as $k => $v) {
$hasCar = VehicleRent::where('car_id',$v['id'])->find(); $hasCar = VehicleRent::where('car_id',$v['id'])->findOrEmpty();
if($hasCar->isEmpty()){ if($hasCar->isEmpty()){
$data[$k]['car_id'] = $v['id']; $data[$k]['car_id'] = $v['id'];
$data[$k]['car_license'] = $v['license']; $data[$k]['car_license'] = $v['license'];
@ -432,7 +432,7 @@ class IndexController extends BaseApiController
if ($result && isset($param['status']) && $param['status'] == 3) { if ($result && isset($param['status']) && $param['status'] == 3) {
$data = []; $data = [];
foreach ($cars as $k => $v) { foreach ($cars as $k => $v) {
$hasCar = VehicleRent::where('car_id',$v['id'])->find(); $hasCar = VehicleRent::where('car_id',$v['id'])->findOrEmpty();
if($hasCar->isEmpty()) { if($hasCar->isEmpty()) {
$data[$k]['car_id'] = $v['id']; $data[$k]['car_id'] = $v['id'];
$data[$k]['car_license'] = $v['license']; $data[$k]['car_license'] = $v['license'];