Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
semour
/
semour_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
189f6785
authored
Nov 22, 2022
by
SUDPTDUBLXEROFX\Administrator
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
订单生成
parent
614223dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
app/Http/Services/OrderService.php
app/Models/OrderModel.php
app/Http/Services/OrderService.php
View file @
189f6785
...
...
@@ -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"
=>
$
order
Count
,
"order_count"
=>
$
status
Count
,
"bank_info"
=>
self
::
$bank_info
,
"total"
=>
$res
[
"total"
],
//返回总条数
"page"
=>
$res
[
"current_page"
],
//第几页
...
...
app/Models/OrderModel.php
View file @
189f6785
...
...
@@ -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"
,
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment