Commit 716506e3 authored by zhoujun's avatar zhoujun

优化预警逻辑

parent dabfa692
......@@ -41,7 +41,6 @@ class ScriptService implements IScriptService
$warnPeople = self::getWarnPeople();
if(empty($warnPeople)) return true;
$logs = SyceeWithdrawModel::where('sycee_withdraw.status',1)->where('sycee_withdraw.serial','>',$lastId)->where('sycee_withdraw.cash','>',$oneMin)->join('account','sycee_withdraw.user_id','account.user_id')->orderBy('sycee_withdraw.serial','ASC')->select('account.user_id','account.platform','account.platform_id','account.channel','sycee_withdraw.serial','sycee_withdraw.cash','sycee_withdraw.withdraw_time')->limit(100)->get();
$array = [];
$maxId = 0;
foreach($logs as $log){
......@@ -71,7 +70,6 @@ class ScriptService implements IScriptService
Log::setGroup('Commands')->info('单次预警数据', ['info' => ['time'=>date('Y-m-d H:i:s'),'data'=>$array]]);
DB::beginTransaction();
print_r($maxId);
try{
if(!empty($array)) WarnWaitModel::insert($array);
if($maxId > 0) self::getUpdateLastId(2,$maxId);
......@@ -226,7 +224,6 @@ class ScriptService implements IScriptService
Log::setGroup('Commands')->info('聚合玩家提现数据', ['info' => ['time'=>date('Y-m-d H:i:s'),'data'=>$array]]);
DB::beginTransaction();
try{
print_r($array);
if(!empty($array)){
foreach($array as $key=>$arr){
$verity = UserCashModel::where('ymd',$arr['ymd'])->where('user_id',$arr['user_id'])->select('id','cash')->first();
......@@ -331,8 +328,7 @@ class ScriptService implements IScriptService
if(empty($config) || $userMin == 0) return true;
$warnPeople = self::getWarnPeople();
if(empty($warnPeople)) return true;
$cash = UserCashModel::where('ymd',$ymd)->select('platform','channel','user_id','open_id','cash')->get();
$cash = UserCashModel::where('ymd',$ymd)->where('cash','>',$userMin)->select('platform','channel','user_id','open_id','cash')->get();
$array = [];
foreach($cash as $log){
$key = $log->platform.'-'.$log->channel;
......@@ -340,7 +336,6 @@ class ScriptService implements IScriptService
if(empty($warnConfig)) continue;
$people = $warnPeople[$key] ?? [];
if(empty($people)) continue;
if($log->cash < $userMin) continue;
$tem['ymd'] = date('Ymd',strtotime($this->time));
$tem['config_id'] = $warnConfig['id'];
......@@ -357,7 +352,6 @@ 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){
......
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