订单生成

parent 614223dc
......@@ -230,10 +230,11 @@ class OrderService
'order_sn',
'order_amount',
'status',
'create_time',
])
->orderBy('order_id', 'desc');
$param["user_id"] = $user_id;
$query->where("user_id",$user_id);
#拼接搜索
foreach ($param as $a => $b) {
$b = trim($b);
......@@ -298,6 +299,8 @@ class OrderService
"payment_surcharge"=>\Arr::get($priceArr,5,0), //支付手续费
"merchandise_total"=>$merchandise_total, //商品总额
"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
->where("user_id",$user_id)
->groupBy('status')
->get()
// ->keyby("status")
->keyby("status")
->toArray();
$statusCount[0] = $res["total"];
foreach (OrderModel::$status as $k=>$v){
$statusCount[$k] = \Arr::get(\Arr::get($orderCount,$k),"num",0);
}
return [
"order_count"=>$orderCount,
"order_count"=>$statusCount,
"bank_info"=>self::$bank_info,
"total"=> $res["total"], //返回总条数
"page"=>$res["current_page"], //第几页
......
......@@ -30,9 +30,9 @@ class OrderModel extends Model
self::status_cancel => "Cancelled",
self::status_waiting_approval => "Waiting for approval",
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_half_send => "",
// self::status_waiting_half_send => "",
self::status_waiting_delivery => "Waiting for delivery",
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