Commit 71d10771 by 朱继来

处理支付记录

parent d72ac8cb
......@@ -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
......@@ -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'); // 处理支付记录
});
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