深茂

parent 26f30dfa
...@@ -60,7 +60,7 @@ class CartApiController extends Controller ...@@ -60,7 +60,7 @@ class CartApiController extends Controller
//购物车列表 //购物车列表
public function cartLists(Request $request){ public function cartLists(Request $request){
$result = CartService::cartLists($request->user->id,$request->user->gid); $result = CartService::cartLists($request->user->id,$request->user->gid,$request->input("cart_ids",0));
return $this->setSuccessData($result); return $this->setSuccessData($result);
} }
......
...@@ -187,8 +187,7 @@ class CartService ...@@ -187,8 +187,7 @@ class CartService
/* /*
* 刷新购物车并且返回列表 * 刷新购物车并且返回列表
*/ */
public static function cartLists($user_id,$gid="",$page_size=400,$page=1){ public static function cartLists($user_id,$gid="",$cart_ids=0,$page_size=400,$page=1){
//当前用户所有可用的购物车数据 //当前用户所有可用的购物车数据
if (!$user_id && !$gid){ if (!$user_id && !$gid){
return []; return [];
...@@ -201,6 +200,9 @@ class CartService ...@@ -201,6 +200,9 @@ class CartService
} }
$query = CartModel::where($where)->wherein("status",[CartModel::status_no,CartModel::status_yes])->orderBy('status', 'desc'); $query = CartModel::where($where)->wherein("status",[CartModel::status_no,CartModel::status_yes])->orderBy('status', 'desc');
if($cart_ids){
$query = $query->wherein("cart_id",explode(",",$cart_ids));
}
$res = $query->paginate($page_size, ['*'], 'page', $page)->toArray(); $res = $query->paginate($page_size, ['*'], 'page', $page)->toArray();
$result = $res["data"]; $result = $res["data"];
......
...@@ -44,6 +44,7 @@ class OrderService ...@@ -44,6 +44,7 @@ class OrderService
$billing_address_id = $data["billing_address_id"]; //账单地址 $billing_address_id = $data["billing_address_id"]; //账单地址
$items = json_decode(\Arr::get($data, 'items', []),true); $items = json_decode(\Arr::get($data, 'items', []),true);
//查询用户详情 //查询用户详情
$userInfo = UserModel::getUserInfo($user_id); $userInfo = UserModel::getUserInfo($user_id);
$order_sn = self::createOrderSn(); $order_sn = self::createOrderSn();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment