|
|
|
@ -12,7 +12,9 @@ class ShopCartService implements ShopCartServiceInterface |
|
|
|
public function do() |
|
|
|
{ |
|
|
|
$storeIds = Db::table('lanzu_shopping_cart')->where('user_id',15)->pluck('store_id')->toArray(); |
|
|
|
$res = Store::query()->with('shoppingCart')->whereIn('id',$storeIds) |
|
|
|
$res = Store::query()->with(['ShoppingCart' => function($query) { |
|
|
|
$query->with('goods'); |
|
|
|
}])->whereIn('id',$storeIds) |
|
|
|
->get(); |
|
|
|
return $res; |
|
|
|
} |
|
|
|
@ -25,7 +27,9 @@ class ShopCartService implements ShopCartServiceInterface |
|
|
|
public function undo() |
|
|
|
{ |
|
|
|
$storeIds = Db::table('lanzu_shopping_cart')->where('user_id',198)->pluck('store_id')->toArray(); |
|
|
|
$res = Store::query()->with('shoppingCart')->whereIn('id',$storeIds) |
|
|
|
$res = Store::query()->with(['ShoppingCart' => function($query) { |
|
|
|
$query->with('goods'); |
|
|
|
}])->whereIn('id',$storeIds) |
|
|
|
->get(); |
|
|
|
return $res; |
|
|
|
} |
|
|
|
|