Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
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
d59a4fee
authored
May 14, 2018
by
朱继来
Browse files
Options
_('Browse Files')
Download
Plain Diff
fix conflict
parents
98596290
62bf410b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
app/Http/Controllers/OrderController.php
app/Http/routes.php
app/Http/Controllers/OrderController.php
View file @
d59a4fee
...
...
@@ -1444,4 +1444,35 @@ Class OrderController extends Controller
return
[
'errcode'
=>
0
,
'errmsg'
=>
'延长成功'
];
}
// 自营订单到达48小时后自动取消订单
public
function
selfOrderCancel
()
{
$order
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order'
)
->
whereNotIn
(
'user_id'
,
$this
->
testMobile
())
->
where
(
'status'
,
'='
,
2
)
->
where
(
'order_goods_type'
,
'='
,
2
)
->
where
(
'is_type'
,
'='
,
0
)
->
select
(
'order_id'
,
'create_time'
)
->
orderBy
(
'create_time'
,
'DESC'
)
->
get
();
if
(
!
empty
(
$order
))
{
foreach
(
$order
as
$v
)
{
$limit_time
=
$v
->
create_time
+
2
*
86400
;
if
(
$limit_time
<=
time
())
{
$update
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order'
)
->
where
(
'order_id'
,
'='
,
$v
->
order_id
)
->
update
([
'status'
=>
-
1
,
'cancel_time'
=>
time
()]);
if
(
$update
)
{
continue
;
}
}
}
}
}
}
\ No newline at end of file
app/Http/routes.php
View file @
d59a4fee
...
...
@@ -70,5 +70,6 @@ Route::group(['middleware' => 'web'], function () {
Route
::
group
([
'middleware'
=>
'api'
],
function
()
{
Route
::
get
(
'/api/check/sendsms'
,
'OrderController@checkOrderSendSms'
);
Route
::
get
(
'/api/check/cancelorder'
,
'OrderController@checkOrderCancel'
);
Route
::
get
(
'/api/check/cancelselforder'
,
'OrderController@selfOrderCancel'
);
});
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