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
ff758472
authored
Dec 01, 2022
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
订单bug修改
parent
08872ccb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
2 deletions
app/Admin/Controllers/OrderController.php
app/Models/Order.php
resources/lang/en/order.php
resources/lang/zh_CN/order.php
app/Admin/Controllers/OrderController.php
View file @
ff758472
...
...
@@ -53,7 +53,7 @@ class OrderController extends AdminController
$user
=
request
()
->
user
;
// dump(PermService::getUserPerms());
return
Grid
::
make
(
new
Order
(),
function
(
Grid
$grid
)
{
$grid
->
model
()
->
rule
(
Order
::
$ruleViewList
)
->
with
(
"scmUser"
)
->
orderBy
(
'order_id'
,
'desc'
);
$grid
->
model
()
->
rule
(
Order
::
$ruleViewList
)
->
with
(
"scmUser"
)
->
with
(
"order_price"
)
->
orderBy
(
'order_id'
,
'desc'
);
$grid
->
fixColumns
(
1
,
2
);
//固定列
// $grid->showColumnSelector();//开启字段选择器功能
// 在 display 回调中使用
...
...
@@ -73,7 +73,22 @@ class OrderController extends AdminController
});
$grid
->
column
(
'scmUser.name'
,
admin_trans
(
'scm-user.fields.name'
));
$grid
->
column
(
'order_amount'
)
->
help
(
'订单详情里-结算信息的“运费”“支付手续费”“其他费用”为空时;应付金额一栏为“待确认”'
);
$grid
->
column
(
'order_price'
,
"应付金额"
)
->
display
(
function
(
$order_price
)
{
$otherAmount
=
0
;
foreach
(
$order_price
->
toArray
()
as
$key
=>
$val
){
if
(
in_array
(
$val
[
"price_type"
],[
3
,
5
])){
$otherAmount
+=
$val
[
"price"
];
}
}
if
(
$otherAmount
==
0
){
return
"待确认"
;
}
else
{
return
decimal_number_format_usd
(
$otherAmount
+
$otherAmount
);
}
});
$grid
->
column
(
'order_pay_type'
)
->
using
(
admin_trans
(
'order.options.order_pay_type'
))
->
sortable
();
$grid
->
column
(
'order_user_pay_type'
,
admin_trans
(
"order.fields.order_user_pay_type"
))
->
display
(
function
()
{
return
Arr
::
get
(
admin_trans
(
"order.options.order_user_pay_type"
),
$this
->
order_user_pay_type
,
""
);
...
...
app/Models/Order.php
View file @
ff758472
...
...
@@ -102,6 +102,7 @@ class Order extends BaseModel
return
$orderInfo
?
$orderInfo
->
toArray
()
:
[];
}
//取消
public
static
function
canelOrder
(
$orderId
=
0
){
return
self
::
where
(
"order_id"
,
$orderId
)
->
update
([
...
...
resources/lang/en/order.php
View file @
ff758472
...
...
@@ -10,6 +10,7 @@ return [
'是否确认审核'
=>
'Do you confirm the audit'
,
'审核成功'
=>
'Successful audit'
,
'是否确认反审核'
=>
'Whether to confirm counteraudit'
,
'待确认'
=>
'To be confirmed'
,
],
'fields'
=>
[
...
...
resources/lang/zh_CN/order.php
View file @
ff758472
...
...
@@ -10,6 +10,7 @@ return [
'是否确认审核'
=>
'是否确认审核'
,
'审核成功'
=>
'是否确认审核'
,
'是否确认反审核'
=>
'是否确认审核'
,
'待确认'
=>
'待确认'
,
],
'fields'
=>
[
...
...
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