Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
semour
/
semour_admin
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
b85d3ca1
authored
Dec 01, 2022
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
订单详情修改明细
parent
b4dffc04
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
app/Admin/Service/OrderService.php
app/Models/OrderPrice.php
app/Admin/Service/OrderService.php
View file @
b85d3ca1
...
...
@@ -172,6 +172,7 @@ class OrderService extends BaseService
//修改订单总金额
self
::
pullOrderAmount
(
$order_id
);
//修改订单备注
if
(
$order_remark
){
Order
::
updateOrder
([
"order_id"
=>
$order_id
],[
...
...
@@ -191,9 +192,11 @@ class OrderService extends BaseService
//拉取订单明细金额 回写订单主表
public
static
function
pullOrderAmount
(
$order_id
=
0
){
$amount
=
OrderItem
::
getOrderTotalAmount
(
$order_id
);
$orderInfo
=
Order
::
getOne
(
$order_id
);
Order
::
updateOrder
([
"order_id"
=>
$order_id
],[
"order_amount"
=>
$amount
,
]);
OrderPrice
::
updateOrderAmount
(
$order_id
,
$orderInfo
[
"order_sn"
]
??
""
,
$amount
);
}
...
...
app/Models/OrderPrice.php
View file @
b85d3ca1
...
...
@@ -61,4 +61,17 @@ class OrderPrice extends Model
}
//
public
static
function
updateOrderAmount
(
$orderId
,
$orderSn
,
$orderAmount
=
0
){
self
::
updateOrCreate
([
"order_id"
=>
$orderId
,
"price_type"
=>
self
::
$PRICE_TYPE_LIST
[
"货款"
],
],[
"order_sn"
=>
$orderSn
,
"price"
=>
decimal_number_format
(
$orderAmount
),
"currency"
=>
2
,
"create_time"
=>
time
(),
]);
}
}
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