Commit 21e8b3f2 authored by zhoujun's avatar zhoujun

调整日志类别

parent 27829f87
Pipeline #2184 passed with stage
in 0 seconds
......@@ -47,6 +47,7 @@ class ClearLogData extends Command
{
set_time_limit(0);
$this->line('开始');
Log::setGroup('Commands')->info('清除历史聚合数据', ['info' => ['time'=>date('Y-m-d H:i:s')]]);
$this->scriptService->getClearLogData();
$this->line('结束');
}
......
......@@ -47,6 +47,7 @@ class PolymerizeWithdrawal extends Command
{
set_time_limit(0);
$this->line('开始');
Log::setGroup('Commands')->info('聚合玩家提现数据', ['info' => ['time'=>date('Y-m-d H:i:s')]]);
$this->scriptService->getPolymerizeWithdrawal();
$this->line('结束');
}
......
......@@ -47,6 +47,7 @@ class SendDDMsg extends Command
{
set_time_limit(0);
$this->line('开始');
Log::setGroup('Commands')->info('发送钉钉消息预警', ['info' => ['time'=>date('Y-m-d H:i:s')]]);
$this->scriptService->getSendDDMsg();
$this->line('结束');
}
......
......@@ -47,6 +47,7 @@ class SingleDayWithdrawal extends Command
{
set_time_limit(0);
$this->line('开始');
Log::setGroup('Commands')->info('单日提现预警', ['info' => ['time'=>date('Y-m-d H:i:s')]]);
$this->scriptService->getSingleDayWithdrawal();
$this->line('结束');
}
......
......@@ -47,6 +47,7 @@ class SingleUserDayWithdrawal extends Command
{
set_time_limit(0);
$this->line('开始');
Log::setGroup('Commands')->info('单日单用户提现预警', ['info' => ['time'=>date('Y-m-d H:i:s')]]);
$this->scriptService->getSingleUserDayWithdrawal();
$this->line('结束');
}
......
......@@ -47,6 +47,7 @@ class SingleWithdrawal extends Command
{
set_time_limit(0);
$this->line('开始');
Log::setGroup('Commands')->info('单次提现预警', ['info' => ['time'=>date('Y-m-d H:i:s')]]);
$this->scriptService->getSingleWithdrawal();
$this->line('结束');
}
......
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use PDOException;
use RedisException;
use Illuminate\Support\Facades\Redis;
use App\Http\Controllers\Controller;
class CheckController extends Controller
{
public function getCheckDB()
{
$dbNames = ['mysql' => '小游戏数据库'];
foreach ($dbNames as $key => $val) {
try {
DB::connection($key)->getPdo();
} catch (PDOException $e) {
return response('小游戏(clubAdmin):' . $val . '连接失败(' . $key . ')<br>' . $e->getMessage(), 500);
}
}
return response('OK');
}
}
\ No newline at end of file
......@@ -67,6 +67,8 @@ class ScriptService implements IScriptService
$tem['updated_at'] = $this->time;
$array[] = $tem;
}
Log::setGroup('Commands')->info('单次预警数据', ['info' => ['time'=>date('Y-m-d H:i:s'),'data'=>$array]]);
DB::beginTransaction();
try{
if(!empty($array)) WarnWaitModel::insert($array);
......@@ -219,7 +221,7 @@ class ScriptService implements IScriptService
$array[$key] = $tem;
}
}
Log::setGroup('Commands')->info('聚合玩家提现数据', ['info' => ['time'=>date('Y-m-d H:i:s'),'data'=>$array]]);
DB::beginTransaction();
try{
if(!empty($array)){
......@@ -301,7 +303,7 @@ class ScriptService implements IScriptService
$tem['updated_at'] = $this->time;
$array[] = $tem;
}
Log::setGroup('Commands')->info('单日最高提现预警', ['info' => ['time'=>date('Y-m-d H:i:s'),'data'=>$array]]);
if(!empty($array)){
foreach($array as $key=>$arr){
$verity = WarnWaitModel::where('ymd',$arr['ymd'])->where('config_id',$arr['config_id'])->where('type',2)->select('id')->first();
......@@ -353,6 +355,8 @@ class ScriptService implements IScriptService
$tem['updated_at'] = $this->time;
$array[] = $tem;
}
Log::setGroup('Commands')->info('单日单用户最高提现预警', ['info' => ['time'=>date('Y-m-d H:i:s'),'data'=>$array]]);
if(!empty($array)){
foreach($array as $key=>$arr){
$verity = WarnWaitModel::where('ymd',$arr['ymd'])->where('user_id',$arr['user_id'])->where('type',3)->select('id')->first();
......@@ -404,5 +408,6 @@ class ScriptService implements IScriptService
}
if(!empty($logs)) WarnLogModel::insert($logs);
return true;
}
}
\ No newline at end of file
......@@ -14,3 +14,5 @@
Route::get('/', function () {
return view('welcome');
});
Route::get('health/status', 'CheckController@getCheckDB');
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 to comment