订单生成

parent 614223dc
...@@ -230,10 +230,11 @@ class OrderService ...@@ -230,10 +230,11 @@ class OrderService
'order_sn', 'order_sn',
'order_amount', 'order_amount',
'status', 'status',
'create_time',
]) ])
->orderBy('order_id', 'desc'); ->orderBy('order_id', 'desc');
$param["user_id"] = $user_id; $query->where("user_id",$user_id);
#拼接搜索 #拼接搜索
foreach ($param as $a => $b) { foreach ($param as $a => $b) {
$b = trim($b); $b = trim($b);
...@@ -298,6 +299,8 @@ class OrderService ...@@ -298,6 +299,8 @@ class OrderService
"payment_surcharge"=>\Arr::get($priceArr,5,0), //支付手续费 "payment_surcharge"=>\Arr::get($priceArr,5,0), //支付手续费
"merchandise_total"=>$merchandise_total, //商品总额 "merchandise_total"=>$merchandise_total, //商品总额
"sub_total "=>$v["order_amount"], //小计 "sub_total "=>$v["order_amount"], //小计
"create_time "=>date('Y-m-d H:i:s', $v['create_time']), //下单时间
"over_time"=> $v["status"] == OrderModel::status_waiting_pay ? date('Y-m-d H:i:s', $v['create_time']+48*3600):"", //截止时间
]; ];
} }
...@@ -306,11 +309,16 @@ class OrderService ...@@ -306,11 +309,16 @@ class OrderService
->where("user_id",$user_id) ->where("user_id",$user_id)
->groupBy('status') ->groupBy('status')
->get() ->get()
// ->keyby("status") ->keyby("status")
->toArray(); ->toArray();
$statusCount[0] = $res["total"];
foreach (OrderModel::$status as $k=>$v){
$statusCount[$k] = \Arr::get(\Arr::get($orderCount,$k),"num",0);
}
return [ return [
"order_count"=>$orderCount, "order_count"=>$statusCount,
"bank_info"=>self::$bank_info, "bank_info"=>self::$bank_info,
"total"=> $res["total"], //返回总条数 "total"=> $res["total"], //返回总条数
"page"=>$res["current_page"], //第几页 "page"=>$res["current_page"], //第几页
......
...@@ -30,9 +30,9 @@ class OrderModel extends Model ...@@ -30,9 +30,9 @@ class OrderModel extends Model
self::status_cancel => "Cancelled", self::status_cancel => "Cancelled",
self::status_waiting_approval => "Waiting for approval", self::status_waiting_approval => "Waiting for approval",
self::status_waiting_pay => "Waiting for payment", self::status_waiting_pay => "Waiting for payment",
self::status_waiting_end_pay => "", //self::status_waiting_end_pay => "",
self::status_waiting_send => " Waiting for dispatch", self::status_waiting_send => " Waiting for dispatch",
self::status_waiting_half_send => "", // self::status_waiting_half_send => "",
self::status_waiting_delivery => "Waiting for delivery", self::status_waiting_delivery => "Waiting for delivery",
self::status_complete => "Transaction Complete", self::status_complete => "Transaction Complete",
]; ];
......
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