Browse Source

确认订单 处理用户没有收货地址

master
Lemon 5 years ago
parent
commit
e60edd1868
  1. 7
      app/Controller/v3/OrderOnlineController.php

7
app/Controller/v3/OrderOnlineController.php

@ -87,10 +87,9 @@ class OrderOnlineController extends BaseController
throw new ErrorCodeException(ErrorCode::NOT_BIND_TEL_ERROR); throw new ErrorCodeException(ErrorCode::NOT_BIND_TEL_ERROR);
} }
//获取用户收货地址 //获取用户收货地址
$address = UserAddress::query()->where([
['user_id','=',$userId],
['is_default','=',1],
])
$address = UserAddress::query()->where('user_id',$userId)
->orderByDesc('is_default')
->orderByDesc('updated_at')
->first(); ->first();
$res['location'] = [ $res['location'] = [
'address' => $address, 'address' => $address,

Loading…
Cancel
Save