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
7af45a57
authored
Nov 18, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'dev/ver/1.0.0' of
http://git.ichunt.net/semour/semour_web
into dev/ver/1.0.0
parents
f54cf88f
14030f52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
app/Http/Services/OrderService.php
app/Http/Services/OrderService.php
View file @
7af45a57
...
...
@@ -17,6 +17,17 @@ use App\Models\CartModel;
//订单服务层
class
OrderService
{
#收款常量
static
$bank_info
=
[
"paypal"
=>
"Paypal@semour.com"
,
"ttl_bank_name"
=>
"HSBC Hong Kong"
,
"ttl_bank_address"
=>
"1 Queen's Road Central, Hong Kong"
,
"ttl_swift_code"
=>
"HSBCHKHHHKH"
,
"ttl_company_name"
=>
"SEMOUR ELECTRONICS CO., LIMITED"
,
"ttl_account_no"
=>
"819-847187-838"
,
];
/*
* 新增订单
address_id:0
...
...
@@ -257,6 +268,19 @@ class OrderService
$items
=
OrderItemsModel
::
where
(
"order_id"
,
$order_id
)
->
get
()
->
toArray
();
$orderAddress
=
\Arr
::
get
(
$orderAddressArr
,
$order_id
,[]);
$merchandise_total
=
0
;
//商品总额
foreach
(
$items
as
$a
=>
$b
){
$ext_price
=
round
(
$b
[
"goods_number"
]
*
$b
[
"goods_price"
],
2
);
$merchandise_total
+=
$ext_price
;
}
$priceInfo
=
OrderPriceModel
::
selectRaw
(
"price_type,price"
)
->
where
(
"order_id"
,
$order_id
)
->
get
()
->
toArray
();
//金额类型(正数ID大于0,负数ID小于0)-8活动优惠 -7支付优惠 -6运费优惠 -5尾款减款 -4优惠券优惠金额 -3尾款 -2预付款 -1付款,1货款 2附加费 3运费 4退款 5支付手续费
$priceArr
=
array_column
(
$priceInfo
,
"price"
,
"price_type"
);
$temp
[]
=
[
"order_id"
=>
$order_id
,
"order_sn"
=>
$v
[
"order_sn"
],
...
...
@@ -268,10 +292,15 @@ class OrderService
"email"
=>
\Arr
::
get
(
$orderAddress
,
"email"
),
"phone"
=>
\Arr
::
get
(
$orderAddress
,
"phone"
),
"shipping_address"
=>
\Arr
::
get
(
$orderAddress
,
"detail_address"
),
"shipping"
=>
\Arr
::
get
(
$priceArr
,
3
,
0
),
//运费
"payment_surcharge"
=>
\Arr
::
get
(
$priceArr
,
5
,
0
),
//支付手续费
"merchandise_total"
=>
$merchandise_total
,
//商品总额
"sub_total "
=>
$v
[
"order_amount"
],
//小计
];
}
return
[
"bank_info"
=>
self
::
$bank_info
,
"total"
=>
$res
[
"total"
],
//返回总条数
"page"
=>
$res
[
"current_page"
],
//第几页
"page_size"
=>
\Arr
::
get
(
$param
,
"page_size"
,
10
),
//每页多少条
...
...
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