Commit d59a4fee by 朱继来

fix conflict

parents 98596290 62bf410b
...@@ -1444,4 +1444,35 @@ Class OrderController extends Controller ...@@ -1444,4 +1444,35 @@ Class OrderController extends Controller
return ['errcode'=>0, 'errmsg'=>'延长成功']; 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
...@@ -70,5 +70,6 @@ Route::group(['middleware' => 'web'], function () { ...@@ -70,5 +70,6 @@ Route::group(['middleware' => 'web'], function () {
Route::group(['middleware' => 'api'], function () { Route::group(['middleware' => 'api'], function () {
Route::get ('/api/check/sendsms', 'OrderController@checkOrderSendSms'); Route::get ('/api/check/sendsms', 'OrderController@checkOrderSendSms');
Route::get ('/api/check/cancelorder', 'OrderController@checkOrderCancel'); Route::get ('/api/check/cancelorder', 'OrderController@checkOrderCancel');
Route::get ('/api/check/cancelselforder', 'OrderController@selfOrderCancel');
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment