Browse Source

购物车

master
weigang 5 years ago
parent
commit
5a7b8bb609
  1. 2
      app/Controller/v3/OrderOnlineController.php
  2. 2
      app/Service/v3/Implementations/CouponRecService.php
  3. 2
      app/Service/v3/Interfaces/CouponRecServiceInterface.php

2
app/Controller/v3/OrderOnlineController.php

@ -142,7 +142,7 @@ class OrderOnlineController extends BaseController
$res['store_list'] = $this->shopCartService->getGoodsByShopcartId($shopcartIds); $res['store_list'] = $this->shopCartService->getGoodsByShopcartId($shopcartIds);
//获取用户优惠券 //获取用户优惠券
$coupons = $this->couponRecService->allForOnlineOrderAvailable($userId, $marketId, $shopcartIds);
$coupons = $this->couponRecService->allForOnlineOrderAvailable($userId, $marketId, explode(',', $shopcartIds));
$res['coupon'] = [ $res['coupon'] = [
'available' => [], 'available' => [],
'not_available' => [], 'not_available' => [],

2
app/Service/v3/Implementations/CouponRecService.php

@ -147,7 +147,7 @@ class CouponRecService implements CouponRecServiceInterface
* @param $shopcartIds * @param $shopcartIds
* @return array * @return array
*/ */
public function allForOnlineOrderAvailable($userId, $marketId, $shopcartIds)
public function allForOnlineOrderAvailable($userId, $marketId, $shopcartIds = [])
{ {
// 获取购物车数据 // 获取购物车数据
$carts = $this->shopCartService->allForUser($userId, $marketId, $shopcartIds); $carts = $this->shopCartService->allForUser($userId, $marketId, $shopcartIds);

2
app/Service/v3/Interfaces/CouponRecServiceInterface.php

@ -9,7 +9,7 @@ interface CouponRecServiceInterface
public function undo(); public function undo();
public function allForOrderOlAvailable($totalAmount,$userId,$marketId,$type,$storeTypeId); public function allForOrderOlAvailable($totalAmount,$userId,$marketId,$type,$storeTypeId);
public function getListByUser($userId,$type,$page = 1,$pagesize = 5); public function getListByUser($userId,$type,$page = 1,$pagesize = 5);
public function allForOnlineOrderAvailable($userId, $marketId, $shopcartIds);
public function allForOnlineOrderAvailable($userId, $marketId, $shopcartIds = []);
/** /**
* 统计用户可使用优惠券数量 * 统计用户可使用优惠券数量
* @param $userId * @param $userId

Loading…
Cancel
Save