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

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

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