From 1e1901b92b9ed977c8f910967feb7597abb377be Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Tue, 8 Sep 2020 13:11:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/v3/OrderOnlineController.php | 9 +++++---- app/Controller/v3/ShopCartController.php | 2 +- app/Service/v3/Implementations/ShopCartService.php | 2 +- app/Service/v3/Interfaces/ShopCartServiceInterface.php | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/Controller/v3/OrderOnlineController.php b/app/Controller/v3/OrderOnlineController.php index b740c7b..0a433b5 100644 --- a/app/Controller/v3/OrderOnlineController.php +++ b/app/Controller/v3/OrderOnlineController.php @@ -70,7 +70,8 @@ class OrderOnlineController extends BaseController * */ public function review() { - $params = $this->request->all(); + $userId = $this->request->input('user_id'); + $marketId = $this->request->input('market_id'); //判断用户有没有绑定手机 // $telExists = $this->userBindTelService->check($params['user_id']); // if(!$telExists){ @@ -81,10 +82,10 @@ class OrderOnlineController extends BaseController //返回预约送达时间 数组 $res['appointment_time'] = $this->appointmentTimeService->do(); // - $res['store_list'] = $this->shopCartService->do(); + $res['store_list'] = $this->shopCartService->do($userId,$marketId); //获取用户优惠券 - $res['coupon']['available'] = $this->couponRecService->allForOrderOlAvailable('181.02',$params['user_id'],'',1,'',''); - $res['coupon']['not_available'] = $this->couponRecService->allForOrderOlAvailable('181.02',$params['user_id'],'',1,'',''); + $res['coupon']['available'] = $this->couponRecService->allForOrderOlAvailable('181.02',$userId,'',1,''); + $res['coupon']['not_available'] = $this->couponRecService->allForOrderOlAvailable('181.02',$userId,'',1,''); //获取配送费 $res['distribution_price'] = '5.0'; //增值服务接口 diff --git a/app/Controller/v3/ShopCartController.php b/app/Controller/v3/ShopCartController.php index 4eca551..123177f 100644 --- a/app/Controller/v3/ShopCartController.php +++ b/app/Controller/v3/ShopCartController.php @@ -30,7 +30,7 @@ class ShopCartController extends BaseController { $userId = $this->request->input('user_id'); $marketId = $this->request->input('market_id'); - $res['shopcart']['count'] = $this->shopCartService->countGoods(); + $res['shopcart']['count'] = $this->shopCartService->countGoods($userId,$marketId); $res['shopcart']['total'] = $this->shopCartService->getTotal($userId,$marketId); return $this->success($res); } diff --git a/app/Service/v3/Implementations/ShopCartService.php b/app/Service/v3/Implementations/ShopCartService.php index 5024dcf..cec7f21 100644 --- a/app/Service/v3/Implementations/ShopCartService.php +++ b/app/Service/v3/Implementations/ShopCartService.php @@ -128,7 +128,7 @@ class ShopCartService implements ShopCartServiceInterface return $storeArr; } - public function countGoods() + public function countGoods($userId,$marketId) { return mt_rand(1,100); } diff --git a/app/Service/v3/Interfaces/ShopCartServiceInterface.php b/app/Service/v3/Interfaces/ShopCartServiceInterface.php index 0038524..ae10a82 100644 --- a/app/Service/v3/Interfaces/ShopCartServiceInterface.php +++ b/app/Service/v3/Interfaces/ShopCartServiceInterface.php @@ -10,7 +10,7 @@ interface ShopCartServiceInterface public function undo($userId,$marketId); - public function countGoods(); + public function countGoods($userId,$marketId); public function getTotal($userId,$marketId); } \ No newline at end of file