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
71d10771
authored
Jul 24, 2019
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
处理支付记录
parent
d72ac8cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
app/Http/Controllers/SpecialController.php
app/Http/routes.php
app/Http/Controllers/SpecialController.php
View file @
71d10771
...
...
@@ -7,6 +7,7 @@ use App\Http\Controllers\Controller;
use
App\Model\OrderModel
;
use
App\Model\UserMainModel
;
use
App\Model\OrderActionLogModel
;
use
App\Model\PayLogModel
;
use
DB
;
use
Excel
;
use
Log
;
...
...
@@ -202,4 +203,34 @@ class SpecialController extends Controller
return
$user
->
userId
;
}
// 处理支付记录
public
function
handlePayLog
()
{
$PayLogModel
=
new
PayLogModel
();
$pay_log
=
$PayLogModel
->
where
(
'pay_type'
,
4
)
->
where
(
'is_paid'
,
-
1
)
->
orderBy
(
'create_time'
,
'desc'
)
->
get
()
->
toArray
();
$data
=
[];
foreach
(
$pay_log
as
$k
=>
$v
)
{
$log
=
$PayLogModel
->
where
(
'order_id'
,
$v
[
'order_id'
])
->
where
(
'pay_type'
,
1
)
->
first
();
if
(
!
$log
)
continue
;
// dump($log['order_id'].'==='.date('Y-m-d H:i:s', $log['create_time']).'==='.date('Y-m-d H:i:s', $log['pay_time']));
// $PayLogModel->where('pay_log_id', $v['pay_log_id'])->update(['is_paid'=>1, 'pay_time'=>$log['pay_time']]); // 更新账期支付
// $PayLogModel->where('pay_log_id', $log['pay_log_id'])->delete();
// // 记录到日志
// $monolog = Log::getMonolog();
// $monolog->popHandler();
// Log::useDailyFiles(storage_path('logs/update_pay_log.log'));
// Log::info('更新账期支付记录ID:'.$v['pay_log_id'].',删除的支付记录ID:'.$log['pay_log_id']);
$data
[]
=
$log
[
'pay_log_id'
];
}
dd
(
$data
);
}
}
\ No newline at end of file
app/Http/routes.php
View file @
71d10771
...
...
@@ -144,5 +144,6 @@ Route::group(['middleware' => 'api'], function () {
Route
::
match
([
'get'
,
'post'
],
'/api/check/importdimission'
,
'SpecialController@importDimission'
);
Route
::
get
(
'/act/useramoumt'
,
'CronController@userAmount'
);
// 活动统计用户实付金额
Route
::
get
(
'/act/clear'
,
'CronController@clearData'
);
// 清除活动统计用户表和缓存
Route
::
get
(
'/handle/paylog'
,
'SpecialController@handlePayLog'
);
// 处理支付记录
});
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