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
75ad5f14
authored
Nov 07, 2022
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
弹框操作
parent
d6554ecf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
6 deletions
app/Admin/Controllers/OrderController.php
app/Models/Order.php
app/Admin/Controllers/OrderController.php
View file @
75ad5f14
...
...
@@ -2,7 +2,7 @@
namespace
App\Admin\Controllers
;
use
App\Admin\
Repositories\Order
as
OrderRepository
;
use
App\Admin\
Actions\OrderAuditAction
;
use
App\Models\Cms\CmsUser
;
use
App\Models\Order
;
use
Dcat\Admin\Form
;
...
...
@@ -10,11 +10,7 @@ use Dcat\Admin\Grid;
use
Dcat\Admin\Show
;
use
Dcat\Admin\Http\Controllers\AdminController
;
use
Dcat\Admin\Layout\Content
;
use
Dcat\Admin\Layout\Column
;
use
Dcat\Admin\Layout\Row
;
use
Dcat\Admin\Admin
;
use
App\Admin\Renderable\UserTable
;
use
Dcat\Admin\Models\Administrator
;
class
OrderController
extends
AdminController
...
...
@@ -28,6 +24,7 @@ class OrderController extends AdminController
*/
public
function
index
(
Content
$content
)
{
return
$content
->
translation
(
$this
->
translation
())
->
title
(
$this
->
title
())
...
...
@@ -79,6 +76,9 @@ class OrderController extends AdminController
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
)
{
...
...
@@ -102,6 +102,17 @@ class OrderController extends AdminController
$filter
->
equal
(
'sales_id'
,
trans
(
'inquiry.fields.sales_name'
))
->
select
(
CmsUser
::
pluck
(
'name'
,
'userId'
)
->
where
(
"status"
,
0
)
->
toArray
())
->
width
(
3
);
});
$grid
->
tools
([
new
OrderAuditAction
(),
]);
});
}
...
...
app/Models/Order.php
View file @
75ad5f14
...
...
@@ -17,10 +17,19 @@ class Order extends Model
public
$timestamps
=
false
;
public
static
$STATUS_WAIT_AUDIT
=
1
;
//待审核
public
static
$STATUS_WAIT_PAY
=
2
;
//待付款
public
function
scmUser
()
{
return
$this
->
belongsTo
(
ScmUser
::
class
,
'user_id'
,
'id'
);
}
//审核订单
public
static
function
auditOrder
(
$orderIds
=
[]){
return
self
::
whereIn
(
"order_id"
,
$orderIds
)
->
where
(
"status"
,
self
::
$STATUS_WAIT_AUDIT
)
->
update
([
"status"
=>
self
::
$STATUS_WAIT_PAY
]);
}
}
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