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
99f65a05
authored
Nov 05, 2022
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
订单
parent
2921268a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
6 deletions
app/Admin/Controllers/OrderController.php
app/Admin/Controllers/OrderController.php
View file @
99f65a05
...
...
@@ -3,6 +3,7 @@
namespace
App\Admin\Controllers
;
use
App\Admin\Repositories\Order
as
OrderRepository
;
use
App\Models\Cms\CmsUser
;
use
App\Models\Order
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Grid
;
...
...
@@ -55,7 +56,7 @@ class OrderController extends AdminController
$grid
->
column
(
'order_sn'
)
->
width
(
'120px'
)
->
link
(
function
()
{
return
admin_url
(
'order_items/'
.
$this
->
order_id
);
});
$grid
->
column
(
'status'
)
->
using
(
admin_trans
(
'order.options.status'
));
$grid
->
column
(
'status'
)
->
using
(
admin_trans
(
'order.options.status'
))
->
sortable
()
;
$grid
->
column
(
'company_name'
)
->
display
(
function
(
$company_name
)
{
return
$company_name
?
$company_name
:
"-"
;
});
...
...
@@ -64,21 +65,38 @@ class OrderController extends AdminController
});
$grid
->
column
(
'scmUser.name'
,
admin_trans
(
'scm-user.options.name'
));
$grid
->
column
(
'order_amount'
)
->
help
(
'订单详情里-结算信息的“运费”“支付手续费”“其他费用”为空时;应付金额一栏为“待确认”'
);
$grid
->
column
(
'order_pay_type'
)
->
using
(
admin_trans
(
'order.options.order_pay_type'
));
$grid
->
column
(
'order_pay_type'
)
->
using
(
admin_trans
(
'order.options.order_pay_type'
))
->
sortable
()
;
$grid
->
column
(
'fukuanfangshi'
,
"付款方式"
)
->
display
(
function
()
{
return
"---不知道--"
;
});
$grid
->
column
(
'sale_name'
);
$grid
->
column
(
'order_remark'
);
$grid
->
column
(
'update_time'
)
->
display
(
function
(
$update_time
)
{
$grid
->
column
(
'order_remark'
)
->
limit
(
10
)
;
$grid
->
column
(
'update_time'
)
->
sortable
()
->
display
(
function
(
$update_time
)
{
return
intval
(
$update_time
)
>
0
?
date
(
"Y-m-d H:i:s"
,
intval
(
$update_time
))
:
"-"
;
});
$grid
->
column
(
'create_time'
)
->
display
(
function
(
$create_time
)
{
$grid
->
column
(
'create_time'
)
->
sortable
()
->
display
(
function
(
$create_time
)
{
return
intval
(
$create_time
)
>
0
?
date
(
"Y-m-d H:i:s"
,
intval
(
$create_time
))
:
"-"
;
});
$grid
->
showFilter
();
$grid
->
disableActions
();
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$filter
->
e
qual
(
'order_id'
);
$filter
->
e
xpand
(
true
);
$filter
->
whereBetween
(
'create_time'
,
function
(
$q
)
{
$start
=
strtotime
(
$this
->
input
[
'start'
]
??
null
);
$end
=
strtotime
(
$this
->
input
[
'end'
]
??
null
);
$q
->
whereBetween
(
'create_time'
,
[
$start
,
$end
]);
})
->
datetime
()
->
width
(
3
);
$filter
->
whereBetween
(
'update_time'
,
function
(
$q
)
{
$start
=
strtotime
(
$this
->
input
[
'start'
]
??
null
);
$end
=
strtotime
(
$this
->
input
[
'end'
]
??
null
);
$q
->
whereBetween
(
'update_time'
,
[
$start
,
$end
]);
})
->
datetime
()
->
width
(
3
);
$filter
->
startWith
(
'company_name'
)
->
width
(
3
);
$filter
->
startWith
(
'scmUser.user_sn'
,
admin_trans
(
'scm-user.fields.user_sn'
))
->
width
(
3
);
$filter
->
equal
(
'status'
)
->
select
(
admin_trans
(
'order.options.status'
))
->
width
(
3
);
$filter
->
equal
(
'sales_id'
,
trans
(
'inquiry.fields.sales_name'
))
->
select
(
CmsUser
::
pluck
(
'name'
,
'userId'
)
->
toArray
())
->
width
(
3
);
});
});
}
...
...
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