|
|
|
@ -232,9 +232,10 @@ class ShopCartService implements ShopCartServiceInterface |
|
|
|
* 获取用户购物车数据 |
|
|
|
* @param $userId |
|
|
|
* @param $marketId |
|
|
|
* @param array $shopcartIds |
|
|
|
* @return array |
|
|
|
*/ |
|
|
|
public function allForUser($userId, $marketId) |
|
|
|
public function allForUser($userId, $marketId, $shopcartIds = []) |
|
|
|
{ |
|
|
|
|
|
|
|
bcscale(6); |
|
|
|
@ -246,8 +247,12 @@ class ShopCartService implements ShopCartServiceInterface |
|
|
|
} |
|
|
|
]) |
|
|
|
->where(['user_id' => $userId]) |
|
|
|
->where(['market_id' => $marketId]) |
|
|
|
->get(); |
|
|
|
->where(['market_id' => $marketId]); |
|
|
|
if (!empty($carts)) { |
|
|
|
$carts = $carts->whereIn('id', $shopcartIds); |
|
|
|
} |
|
|
|
|
|
|
|
$carts = $carts->get(); |
|
|
|
$cartList = []; |
|
|
|
$totalAmount = 0; |
|
|
|
foreach ($carts as $key => &$cart) { |
|
|
|
|