订单生成

parent 0c87a96b
Showing with 10 additions and 0 deletions
......@@ -260,6 +260,7 @@ class OrderService
if (!$res){
return false;
}
$result = $res["data"];
$orderAddressArr = OrderAddressModel::where("order_address_type",1)->whereIn("order_id", array_column($result, "order_id"))->get()->keyBy("order_id")->toArray(); //地址信息
......@@ -300,7 +301,16 @@ class OrderService
];
}
#统计当前用户各个状态数量
$orderCount = OrderModel::select(DB::raw('count(*) as num, status'))
->where("user_id",$user_id)
->groupBy('status')
->get()
->keyby("status")
->toArray();
return [
"order_count"=>$orderCount,
"bank_info"=>self::$bank_info,
"total"=> $res["total"], //返回总条数
"page"=>$res["current_page"], //第几页
......
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