vali 6 лет назад
Родитель
Сommit
377eb3b90b
3 измененных файлов с 287 добавлено и 156 удалено
  1. 67 26
      app/Logic/DataLogic.php
  2. 217 129
      app/Models/SportsNoteList.php
  3. 3 1
      datainf/logic/HttpServerDataInf.php

+ 67 - 26
app/Logic/DataLogic.php

@@ -482,8 +482,8 @@ class DataLogic
             /*
             //写请求数据 日志记录
             if($this->isRecord){
-                // $setSportsRecord = St_set_sports_recordModel::setSportsRecord($getData['title'],$obt,$getData);
-                // if($setSportsRecord < 1) throw new \Exception(Response::generate('',Response::SPORTS_RECORD_ERR));
+                $setSportsRecord = St_set_sports_recordModel::setSportsRecord($getData['title'],$obt,$getData);
+                if($setSportsRecord < 1) throw new \Exception(Response::generate('',Response::SPORTS_RECORD_ERR));
             }
             */
 
@@ -505,6 +505,8 @@ class DataLogic
             foreach ($match_r_data as $k => $v) {
                 $identity[] = $v['uuid'];
                 $s_match_ids[] = $v['match_id'];
+                //追加获取赛事uuid
+                $match_uuids[] = $v['match_identity'];
             }
 
             //====验证 赛事 所属 联赛 是否存在====
@@ -528,27 +530,26 @@ class DataLogic
             if (!empty($identity)) throw new \Exception(Response::generate($gameName . '联赛:uuid-' . $identity[0] . ';', Response::LEAGUE_ERROR));
             //====end====
 
-            //====验证 赛事结果记录 所属赛事 是否存在====$match_uuids
-            $s_match_ids = array_unique($s_match_ids);
-            sort($s_match_ids);
+            //====验证 赛事结果记录 所属赛事 是否存在====
+            $match_uuids = array_unique($match_uuids);
+            sort($match_uuids);
 
             //获取 本地 已存在 赛事
-            $l_match_data = $models['model_local_match']::whereIn('others_match_id', $s_match_ids)->where('source', $source)->select('others_match_id', 'match_id')->get()->toArray();
-
+            $l_match_data = $models['model_local_match']::whereIn('identity', $match_uuids)->where('source', $source)->select('identity', 'match_id')->get()->toArray();
             //二维数组去重
-            $l_match_data = commonFunction::uniquArrV2($l_match_data, 'others_match_id');
+            $l_match_data = commonFunction::uniquArrV2($l_match_data, 'identity');
 
-            //循环对比 请求match_id->本地others_match_id
+            //循环对比 请求identity->本地identity
             foreach ($l_match_data as $k => $v) {
-                foreach ($s_match_ids as $kk => $s_match_id) {
-                    if ($v['others_match_id'] == $s_match_id) {
-                        unset($s_match_ids[$kk]);
+                foreach ($match_uuids as $kk => $match_identity) {
+                    if ($v['identity'] == $match_identity) {
+                        unset($match_uuids[$kk]);
                     }
                 }
             }
-            sort($s_match_ids);
+            sort($match_uuids);
             //去除本地和请求里都存在的赛事,如果还有剩余赛事id,则返回异常
-            if (!empty($s_match_ids)) throw new \Exception(Response::generate($gameName . '赛事-match_id' . $s_match_ids[0] . ';', Response::MATCH_ERROR));
+            if (!empty($match_uuids)) throw new \Exception(Response::generate($gameName . '赛事-match_id' . $match_uuids[0] . ';', Response::MATCH_ERROR));
             //====end====
 
             //处理 赛事 结果记录 数据
@@ -557,7 +558,7 @@ class DataLogic
                 //获取 本地 联赛 ID
                 $lg_id = commonFunction::searcharray($data['uuid'], 'identity', $l_lg_data, 'lg_id');
                 //获取 本地 赛事 ID
-                $match_id = commonFunction::searcharray($data['match_id'], 'others_match_id', $l_match_data, 'match_id');
+                $match_id = commonFunction::searcharray($data['match_identity'], 'identity', $l_match_data, 'match_id');
 
                 //根据球类 获取 赛事结果记录字段
                 $set_match_r = $this->get_match_r($game_code, $lg_id, $match_id, $data);
@@ -568,7 +569,6 @@ class DataLogic
                 if ($ret != true) throw new \Exception(Response::generate($gameName . '赛事-match_id:' . $data['match_id'] . ';', Response::ADD_MATCH_R_R_ERROR));
             }
 
-
             $this->writeLog($logdata, Response::success());
             //提交事务
             DB::commit();
@@ -623,14 +623,15 @@ class DataLogic
             $tag = $getData['tag'] ?: 99;
             //获取赔率是否是串场
             $is_stringscene = $getData['is_stringscene'];
-
+            //获取数据源赛事uuid
+            $match_identity = $getData['match_identity'];
             //获取球类名称
             $gameName = gameModel::getGameName($game_code);
             //验证本次请求所属联赛/赛事是否存在 返回本地联赛/赛事ID
             $models = commonFunction::getModels($game_code, 1);
 
             $lg_id = $this->leagueVerify($models, $uuid, $source, $gameName);
-            $match_id = $this->matchVerify($models, $s_match_id, $source, $gameName);
+            $match_id = $this->matchVerify_v2($models, $match_identity, $source, $gameName);
 
             //更新赛事 tag 值
             //如果未获取到本地赛事id,则返回异常
@@ -958,20 +959,43 @@ class DataLogic
             //获取 数据源
             $source = $data['source'];
 
-            //获取所有数据源赛事 match_id
+
+            //获取 当前请求 所有 uuid /match_id
             $others_match_ids = [];
+            $match_uuids = [];
             foreach ($data['data'] as $k => $v) {
                 $others_match_ids[] = $v['match_id'];
+                //追加获取赛事uuid
+                $match_uuids[] = $v['match_identity'];
             }
+
             //根据球类代码 获取model
             $model = commonFunction::getModels($game_code, 1);
             //获取所有赛事 match_id
             $local_match = $model['model_local_match']::SELECT('others_match_id', 'match_id')
                 ->where(['source' => $source])
-                ->whereIn('others_match_id', $others_match_ids)
+                ->whereIn('identity', $match_uuids)
                 ->get()->toArray();
             if (empty($local_match)) throw new \Exception(Response::generate('', Response::MATCHID_NULL));
 
+            //设置各球类 判断结束时间
+            if ($game_code == 'zq') {
+                //足球 60分钟
+                $handle_time = 60 * 60;
+            }
+            if ($game_code == 'lq') {
+                //篮球 40分钟
+                $handle_time = 60 * 40;
+            }
+            if ($game_code == 'wq') {
+                //网球 2小时
+                $handle_time = 60 * 60 * 2;
+            }
+            if ($game_code == 'bq') {
+                //棒球 2小时
+                $handle_time = 60 * 60 * 2;
+            }
+
             //取值 更新字段
             foreach ($local_match as $k => $v) {
                 foreach ($data['data'] as $kk => $vv) {
@@ -994,12 +1018,17 @@ class DataLogic
                             ->update($set_status);
                         if ($ret < 1) throw new \Exception(Response::generate($gameName . '赛事-match_id:' . $v['others_match_id'], Response::UPSTATUS_ERROR));
 
-                        //===如果赛事已结束===
-                        if ($vv['status'] == 2) {
+                        //获取赛事开始时间
+                        $game_start_time = $model['model_result']::where(['match_id' => $v['match_id']])->first()->start_time;
+                        //开赛时间 时间戳
+                        $game_start_time_unx = strtotime($game_start_time);
+
+
+                        //===如果赛事已结束 并且 开赛时间< 当前时间-各球类处理时间 ===
+                        if ($vv['status'] == 2 and $game_start_time_unx < (time() - $handle_time)) {
                             // 新增 更新 赛事结果
                             $this->match_result($game_code, $v['match_id']);
-                            //获取赛事开始时间
-                            $game_start_time = $model['model_result']::where(['match_id' => $v['match_id']])->first()->start_time;
+
                             // 写入结算通知表 用于自动结算
                             $Comendnotice = new \App\Models\Comendnotice();
                             $ret_add = $Comendnotice->addcomendnotice($v['match_id'], $game_code, 0, $game_start_time);
@@ -1010,7 +1039,6 @@ class DataLogic
                 }
             }
 
-
             $this->writeLog($sdata, Response::success());
             //提交事务
             DB::commit();
@@ -1417,6 +1445,8 @@ class DataLogic
             $source = $getData['source'];
             //获取数据源赛事id
             $others_match_id = $getData['match_id'];
+            //获取数据源赛事uuid
+            $match_identity = $getData['match_identity'];
             //获取球类名称
             $gameName = gameModel::getGameName($game_code);
             //获取 model
@@ -1426,7 +1456,7 @@ class DataLogic
 
             //获取赛事 match_id
             $match_id = $models['model_local_match']::SELECT('others_match_id', 'match_id')
-                ->where(['source' => $source, 'others_match_id' => $others_match_id])
+                ->where(['source' => $source, 'identity' => $match_identity])
                 ->first()->match_id;
 
             if (!empty($match_id)) {
@@ -1479,6 +1509,17 @@ class DataLogic
         return $l_match_id;
     }
 
+    /*
+     * 验证所属 赛事 是否存在
+     */
+    public function matchVerify_v2($models = [], $match_identity = '', $source = '', $gameName = '')
+    {
+        if (empty($models) || empty($match_identity)) throw new \Exception(Response::generate('', Response::ABNORMAL));
+        $l_match_id = $models['model_local_match']::where(['identity' => $match_identity, 'source' => $source])->value('match_id');
+
+        if ($l_match_id < 1) throw new \Exception(Response::generate($gameName . 'match_identity-' . $match_identity, Response::MATCH_ERROR));
+        return $l_match_id;
+    }
 
     /*
      * 写入直播 数据

+ 217 - 129
app/Models/SportsNoteList.php

@@ -9,8 +9,10 @@
 namespace App\Models;
 
 use Illuminate\Support\Facades\DB;
+use App\Lib\Biz\Sport\Common as commonFunction;
 use App\Models\MoneyBuyMatch;
 use App\Http\Response\Response;
+use App\Http\Model\StZqResult;
 
 class SportsNoteList extends BaseModel
 {
@@ -31,7 +33,7 @@ class SportsNoteList extends BaseModel
             //->join('money_buy_match','money_buy_match.order_id','=','money_buy_simplex.order_id')
             ->join('st_' . $type . '_league', 'money_buy_simplex.lg_id', '=', 'st_' . $type . '_league.id')
             ->select('money_buy_simplex.id', 'money_buy_simplex.account_name', 'money_buy_simplex.is_champion', 'money_buy_simplex.account_identity', 'money_buy_simplex.order_id', 'money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.status', 'money_buy_simplex.money_time', 'money_buy_simplex.settle_status', 'money_buy_simplex.gain_money', 'money_buy_simplex.game_code', 'money_buy_simplex.match_id', 'money_buy_simplex.game_status', 'st_' . $type . '_competition.home_team', 'st_' . $type . '_competition.guest_team', 'st_' . $type . '_competition.match_date', 'st_' . $type . '_competition.match_time', 'st_' . $type . '_competition.lg_id', 'st_' . $type . '_competition.status as match_status', 'money_details.money_cash', 'money_buy_simplex.batch_id', 'st_' . $type . '_league.name_chinese', 'st_' . $type . '_league.last_time')
-            ->whereIn('money_buy_simplex.roll_ratify',array(0,1))
+            ->whereIn('money_buy_simplex.roll_ratify', array(0, 1))
             ->where($where)
             //->distinct('money_buy_match.order_id')
             ->orderby('money_buy_simplex.money_time', 'desc')
@@ -74,10 +76,9 @@ class SportsNoteList extends BaseModel
 
 
         for ($i = 0; $i < count($data); $i++) {
-             if($data[$i]->status==1 && $data[$i]->settle_status == 1){
-             $data[$i]->order_status = '投注'.'<br><a class="layui-btn layui-btn-sm invalid" lay-event="detail" pid="id" uri="/admin/SoccerNoteList/invalid/?id=" href="javascript:invalid(\'/admin/SoccerNoteList/invalid/?id=' . $data[$i]->id . '\',\''.$data[$i]->order_id.'\',\''.$data[$i]->name_chinese.'\');"> 作废 </a>';
-             }
-            else if ($data[$i]->status == 1 && $data[$i]->settle_status != 1) {
+            if ($data[$i]->status == 1 && $data[$i]->settle_status == 1) {
+                $data[$i]->order_status = '投注' . '<br><a class="layui-btn layui-btn-sm invalid" lay-event="detail" pid="id" uri="/admin/SoccerNoteList/invalid/?id=" href="javascript:invalid(\'/admin/SoccerNoteList/invalid/?id=' . $data[$i]->id . '\',\'' . $data[$i]->order_id . '\',\'' . $data[$i]->name_chinese . '\');"> 作废 </a>';
+            } else if ($data[$i]->status == 1 && $data[$i]->settle_status != 1) {
                 $data[$i]->order_status = '投注';
             } else if ($data[$i]->status == 2) {
                 $data[$i]->order_status = '作废';//.'<br><a class="layui-btn layui-btn-sm audit" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: grey;"> 已作废 </a>';
@@ -86,7 +87,7 @@ class SportsNoteList extends BaseModel
             }
             if ($data[$i]->settle_status == 1) {
                 $data[$i]->settle_status = '未结算';
-            } else{
+            } else {
                 $data[$i]->settle_status = '已结算';
             }
             if ($data[$i]->game_status == 0) {
@@ -291,15 +292,15 @@ class SportsNoteList extends BaseModel
         $data['all_money'] = 0;
         $data['all_prize_money'] = 0;
         $data['alraedy_prize_money'] = 0;
-        $all_money = $this->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')->join('st_' . $type . '_league', 'st_' . $type . '_competition.lg_id', '=', 'st_' . $type . '_league.id')->select('money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.gain_money')->whereIn('money_buy_simplex.roll_ratify',array(0,1))->where('money_buy_simplex.status', '1')->get();
+        $all_money = $this->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')->join('st_' . $type . '_league', 'st_' . $type . '_competition.lg_id', '=', 'st_' . $type . '_league.id')->select('money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.gain_money')->whereIn('money_buy_simplex.roll_ratify', array(0, 1))->where('money_buy_simplex.status', '1')->get();
         for ($a = 0; $a < count($all_money); $a++) {
             $data['all_money'] = $data['all_money'] + $all_money[$a]->money;
         }
-        $all_prize_money = $this->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')->join('st_' . $type . '_league', 'st_' . $type . '_competition.lg_id', '=', 'st_' . $type . '_league.id')->select('money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.gain_money')->whereIn('money_buy_simplex.roll_ratify',array(0,1))->where('money_buy_simplex.status', '1')->get();
+        $all_prize_money = $this->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')->join('st_' . $type . '_league', 'st_' . $type . '_competition.lg_id', '=', 'st_' . $type . '_league.id')->select('money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.gain_money')->whereIn('money_buy_simplex.roll_ratify', array(0, 1))->where('money_buy_simplex.status', '1')->get();
         for ($a = 0; $a < count($all_prize_money); $a++) {
             $data['all_prize_money'] = $data['all_money'] + $all_prize_money[$a]->prize_money;
         }
-        $alraedy_prize_money = $this->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')->join('st_' . $type . '_league', 'st_' . $type . '_competition.lg_id', '=', 'st_' . $type . '_league.id')->select('money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.gain_money')->where('money_buy_simplex.settle_status', '2')->whereIn('money_buy_simplex.roll_ratify',array(0,1))->where('money_buy_simplex.status', '1')->get();
+        $alraedy_prize_money = $this->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')->join('st_' . $type . '_league', 'st_' . $type . '_competition.lg_id', '=', 'st_' . $type . '_league.id')->select('money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.gain_money')->where('money_buy_simplex.settle_status', '2')->whereIn('money_buy_simplex.roll_ratify', array(0, 1))->where('money_buy_simplex.status', '1')->get();
         for ($a = 0; $a < count($alraedy_prize_money); $a++) {
             $data['alraedy_prize_money'] = $data['all_money'] + $alraedy_prize_money[$a]->gain_money;
         }
@@ -311,15 +312,15 @@ class SportsNoteList extends BaseModel
             //$data['all_money'] = $this->where($where)->sum('money');
 //            $data['all_prize_money'] = $this->where($where)->sum('prize_money');
 //            $data['alraedy_prize_money'] = $this->where($where)->where('settle_status','2')->sum('gain_money');
-            $all_money = $this->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')->join('st_zq_competition', 'st_zq_competition.id', '=', 'money_buy_simplex.match_id')->join('st_zq_league', 'st_zq_competition.lg_id', '=', 'st_zq_league.id')->select('money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.gain_money')->whereIn('money_buy_simplex.roll_ratify',array(0,1))->where($where)->where('money_buy_simplex.status', '1')->get();
+            $all_money = $this->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')->join('st_zq_competition', 'st_zq_competition.id', '=', 'money_buy_simplex.match_id')->join('st_zq_league', 'st_zq_competition.lg_id', '=', 'st_zq_league.id')->select('money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.gain_money')->whereIn('money_buy_simplex.roll_ratify', array(0, 1))->where($where)->where('money_buy_simplex.status', '1')->get();
             for ($a = 0; $a < count($all_money); $a++) {
                 $data['all_money'] = $data['all_money'] + $all_money[$a]->money;
             }
-            $all_prize_money = $this->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')->join('st_' . $type . '_league', 'st_' . $type . '_competition.lg_id', '=', 'st_' . $type . '_league.id')->select('money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.gain_money')->whereIn('money_buy_simplex.roll_ratify',array(0,1))->where($where)->where('money_buy_simplex.status', '1')->get();
+            $all_prize_money = $this->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')->join('st_' . $type . '_league', 'st_' . $type . '_competition.lg_id', '=', 'st_' . $type . '_league.id')->select('money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.gain_money')->whereIn('money_buy_simplex.roll_ratify', array(0, 1))->where($where)->where('money_buy_simplex.status', '1')->get();
             for ($a = 0; $a < count($all_prize_money); $a++) {
                 $data['all_prize_money'] = $data['all_prize_money'] + $all_prize_money[$a]->prize_money;
             }
-            $alraedy_prize_money = $this->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')->join('st_' . $type . '_league', 'st_' . $type . '_competition.lg_id', '=', 'st_' . $type . '_league.id')->select('money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.gain_money')->whereIn('money_buy_simplex.roll_ratify',array(0,1))->where('money_buy_simplex.settle_status', '2')->where($where)->where('money_buy_simplex.status', '1')->get();
+            $alraedy_prize_money = $this->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')->join('st_' . $type . '_league', 'st_' . $type . '_competition.lg_id', '=', 'st_' . $type . '_league.id')->select('money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.gain_money')->whereIn('money_buy_simplex.roll_ratify', array(0, 1))->where('money_buy_simplex.settle_status', '2')->where($where)->where('money_buy_simplex.status', '1')->get();
             for ($a = 0; $a < count($alraedy_prize_money); $a++) {
                 $data['alraedy_prize_money'] = $data['alraedy_prize_money'] + $alraedy_prize_money[$a]->gain_money;
             }
@@ -360,7 +361,7 @@ class SportsNoteList extends BaseModel
             // ->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.id')
             ->join('st_' . $type . '_league', 'money_buy_simplex.lg_id', '=', 'st_' . $type . '_league.id')
             ->select('money_buy_simplex.id', 'money_buy_simplex.account_name', 'money_buy_simplex.is_champion', 'money_buy_simplex.account_identity', 'money_buy_simplex.order_id', 'money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.status', 'money_buy_simplex.money_time', 'money_buy_simplex.settle_status', 'money_buy_simplex.gain_money', 'money_buy_simplex.game_code', 'money_buy_simplex.match_id', 'money_buy_simplex.game_status', 'st_' . $type . '_competition.home_team', 'st_' . $type . '_competition.guest_team', 'st_' . $type . '_competition.match_date', 'st_' . $type . '_competition.match_time', 'st_' . $type . '_competition.lg_id', 'st_' . $type . '_competition.status as match_status', 'money_details.money_cash', 'money_buy_simplex.batch_id', 'st_' . $type . '_league.name_chinese', 'st_' . $type . '_league.last_time')
-            ->whereIn('money_buy_simplex.roll_ratify',array(0,1))
+            ->whereIn('money_buy_simplex.roll_ratify', array(0, 1))
             ->where($where)
             ->orderby('money_buy_simplex.money_time', 'desc')
             ->paginate($list);
@@ -404,7 +405,7 @@ class SportsNoteList extends BaseModel
 
         for ($i = 0; $i < count($data); $i++) {
             if ($data[$i]->status == 1 && $data[$i]->settle_status == 1) {
-                $data[$i]->order_status = '投注' . '<br><a class="layui-btn layui-btn-sm invalid" lay-event="detail" pid="id" uri="/admin/SoccerNoteList/invalid/?id=" href="javascript:invalid(\'/admin/SoccerNoteList/invalid/?id=' . $data[$i]->id . '\',\''.$data[$i]->order_id.'\',\''.$data[$i]->name_chinese.'\');"> 作废 </a>';
+                $data[$i]->order_status = '投注' . '<br><a class="layui-btn layui-btn-sm invalid" lay-event="detail" pid="id" uri="/admin/SoccerNoteList/invalid/?id=" href="javascript:invalid(\'/admin/SoccerNoteList/invalid/?id=' . $data[$i]->id . '\',\'' . $data[$i]->order_id . '\',\'' . $data[$i]->name_chinese . '\');"> 作废 </a>';
             } else if ($data[$i]->status == 1 && $data[$i]->settle_status != 1) {
                 $data[$i]->order_status = '投注';
             } else if ($data[$i]->status == 2) {
@@ -619,7 +620,7 @@ class SportsNoteList extends BaseModel
             //->join('money_buy_match','money_buy_match.order_id','=','money_buy_simplex.order_id')
             ->join('st_' . $type . '_league', 'money_buy_simplex.lg_id', '=', 'st_' . $type . '_league.id')
             ->select('money_buy_simplex.id', 'money_buy_simplex.account_name', 'money_buy_simplex.is_champion', 'money_buy_simplex.account_identity', 'money_buy_simplex.order_id', 'money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.status', 'money_buy_simplex.money_time', 'money_buy_simplex.settle_status', 'money_buy_simplex.gain_money', 'money_buy_simplex.game_code', 'money_buy_simplex.match_id', 'money_buy_simplex.game_status', 'money_buy_simplex.roll_ratify', 'st_' . $type . '_competition.home_team', 'st_' . $type . '_competition.guest_team', 'st_' . $type . '_competition.match_date', 'st_' . $type . '_competition.match_time', 'st_' . $type . '_competition.lg_id', 'st_' . $type . '_competition.status as match_status', 'money_details.money_cash', 'money_buy_simplex.batch_id', 'st_' . $type . '_league.name_chinese', 'st_' . $type . '_league.last_time')
-            ->whereIn('money_buy_simplex.roll_ratify',array(-1,2))
+            ->whereIn('money_buy_simplex.roll_ratify', array(-1, 2))
             ->where($where)
             //->distinct('money_buy_match.order_id')
             ->orderby('money_buy_simplex.money_time', 'desc')
@@ -662,9 +663,9 @@ class SportsNoteList extends BaseModel
 
 
         for ($i = 0; $i < count($data); $i++) {
-             if($data[$i]->status==1 && $data[$i]->settle_status == 1){
-             $data[$i]->order_status = '投注'.'<br><a class="layui-btn layui-btn-sm invalid" lay-event="detail" pid="id" uri="/admin/SoccerNoteList/invalid/?id=" href="javascript:invalid(\'/admin/SoccerNoteList/invalid/?id=' . $data[$i]->id . '\',\''.$data[$i]->order_id.'\',\''.$data[$i]->name_chinese.'\');"> 作废 </a>';
-             }
+            if ($data[$i]->status == 1 && $data[$i]->settle_status == 1) {
+                $data[$i]->order_status = '投注' . '<br><a class="layui-btn layui-btn-sm invalid" lay-event="detail" pid="id" uri="/admin/SoccerNoteList/invalid/?id=" href="javascript:invalid(\'/admin/SoccerNoteList/invalid/?id=' . $data[$i]->id . '\',\'' . $data[$i]->order_id . '\',\'' . $data[$i]->name_chinese . '\');"> 作废 </a>';
+            }
             if ($data[$i]->status == 1 && $data[$i]->settle_status != 1) {
                 $data[$i]->order_status = '投注';
             } else if ($data[$i]->status == 2) {
@@ -877,31 +878,32 @@ class SportsNoteList extends BaseModel
     }
 
     //作废赛事下注单处理
-    function delorder($matchid,$type){
+    function delorder($matchid, $type)
+    {
         //该赛事的单式注单
         $account_identitys = array();
         $order_ids = array();
-        $orders = $this->where('match_id',$matchid)->get();
-        if(!empty($orders)){
-            for ($c=0; $c < count($orders); $c++){
+        $orders = $this->where('match_id', $matchid)->get();
+        if (!empty($orders)) {
+            for ($c = 0; $c < count($orders); $c++) {
                 $account_identitys[] = $orders[$c]['account_identitys'];
                 $order_ids[] = $orders[$c]['order_id'];
             }
             //用戶账户金额
-            $account_money = \App\Models\Account_detailed::wherein('account_identity',$account_identitys)->get();
+            $account_money = \App\Models\Account_detailed::wherein('account_identity', $account_identitys)->get();
             //反水
-            $water_return_money = \App\Models\Money_details::wherein('trade_id',$order_ids)->where('trade_type', '7')->get();
-            for($i=0;$i<count($orders);$i++){
+            $water_return_money = \App\Models\Money_details::wherein('trade_id', $order_ids)->where('trade_type', '7')->get();
+            for ($i = 0; $i < count($orders); $i++) {
                 //用户余额 默认
                 $available_cash = '';
-                for($a=0;$a<count($account_money);$a++){
-                    if($orders[$i]['account_identity'] == $account_money[$a]['account_identity']){
+                for ($a = 0; $a < count($account_money); $a++) {
+                    if ($orders[$i]['account_identity'] == $account_money[$a]['account_identity']) {
                         $available_cash = $account_money[$a]['available_cash'];
                     }
                 }
                 $water_return = '';
-                for($b=0;$b<count($water_return_money);$b++){
-                    if($orders[$i]['order_id'] == $water_return_money[$b]['trade_id']){
+                for ($b = 0; $b < count($water_return_money); $b++) {
+                    if ($orders[$i]['order_id'] == $water_return_money[$b]['trade_id']) {
                         $water_return = $water_return_money[$b]['money'];
                     } else {
                         $water_return = 0;
@@ -941,30 +943,113 @@ class SportsNoteList extends BaseModel
         }
 
         //该赛事相关的的串关注单做平局处理
-        \App\Models\MoneyBuyMatch::where('match_id',$matchid)->where('game_code',$type)->where('bet_type',2)->update(['result'=>2]);
+        \App\Models\MoneyBuyMatch::where('match_id', $matchid)->where('game_code', $type)->where('bet_type', 2)->update(['result' => 2]);
 
 
     }
 
+    /**
+     * 滚球投注 获取指定时间内未审核订单
+     */
+    public static function getOrderData($time = 60)
+    {
+
+        $db = new \App\Models\Setinfo();
+        //获取设定需审核时间 秒
+        $handle_time = $db->getInfo(1003)['infocontent'] ?: 90;
+
+        //获取需查询 时间条件 时间戳
+        //时间区间 开始时间
+        $time_unx_s = time() - $time - $handle_time;//-150 秒
+        //时间区间 截止时间
+        $time_unx_e = time() - $handle_time;//-90 秒
+
+        //拼接查询条件
+        $where = [
+            ['money_time', '>', date('Y-m-d H:i:s', $time_unx_s)],
+            ['money_time', '<', date('Y-m-d H:i:s', $time_unx_e)],
+            ['roll_ratify', '=', 2]
+        ];
+        //获取 待处理订单数据
+        $order_data = self::where($where)->SELECT('id', 'match_id', 'account_name', 'account_identity', 'order_id', 'money_time', 'roll_ratify', 'money', 'gain_money')->get()->toArray();
+        if (!empty($order_data)) {
+
+            //获取订单所属赛事id
+            $match_ids = [];
+            foreach ($order_data as $k => $v) {
+                $match_ids[] = $v['match_id'];
+            }
+
+            //去重 获取赛事危险球数据
+            $warn_json_data = StZqResult::whereIn('match_id', $match_ids)->SELECT('match_id', 'warn_more')->get()->toArray();
+
+            //获取审核不通过订单 订单号
+            $order_ids_n = [];
+            //获取审核不通过订单
+            $order_data_n = [];
+            //获取审核通过订单 订单号
+            $order_ids_y = [];
+            //获取审核未通过订单 投注人
+            $account_identitys = [];
+            foreach ($order_data as $k => $v) {
+                //获取每个订单的危险球数据
+                $warn_data = commonFunction::filter_by_value($warn_json_data, 'match_id', $v['match_id']);
+                $warn_data_arr = json_decode($warn_data['warn_more'], true);
+                //投注时间 时间戳
+                $order_time = strtotime($v['money_time']);
+                foreach ($warn_data_arr as $kk => $vv) {
+                    //危险球时间 时间戳
+                    $warn_time = strtotime($vv['timei']);
+                    if ($order_time < $warn_time and ($order_time + $handle_time) > $warn_time) {
+                        $order_ids_n[] = $v['order_id'];
+                        $account_identitys[] = $v['account_identity'];
+                        $order_data_n[] = $v;
+                        unset($order_data[$k]);
+                    }
+                }
+            }
+
+            if (!empty($order_data)) {
+                foreach ($order_data as $k => $v) {
+                    $order_ids_y[] = $v['order_id'];
+                }
+            }
+
+            if (!empty($order_ids_n)) {
+                //在审核时间内订单 审核不通过
+                self::HandleMoney_v2($account_identitys, $order_ids_n, $order_data_n);
+            }
+            if (!empty($order_ids_y)) {
+                //在审核时间外订单 审核通过
+                $ret_y = self::whereIn('order_id', $order_ids_y)->update(['roll_ratify' => 1, 'use_mark' => '滚球投注自动审核(危险球)通过']);
+                //如果更新数量小于订单数量 则返回异常
+                if ($ret_y < count($order_ids_y)) throw new \Exception(Response::generate('', Response::HANDLE_ORDER_Y_ERR));
+
+            }
+
+        }
+
+    }
 
     /**
      * 滚球投注 危险球自动审核
      * $match_id  int 赛事id
      * $warn_data  arr 危险球数据
      */
-    public static function WarnHandle($match_id=0,$warn_data=[]){
+    public static function WarnHandle($match_id = 0, $warn_data = [])
+    {
 
-        if(!empty($match_id) and !empty($warn_data)){
+        if (!empty($match_id) and !empty($warn_data)) {
             $db = new \App\Models\Setinfo();
             //获取设定需审核时间 秒
-            $handle_time =  $db->getInfo(1003)['infocontent']?:90;
+            $handle_time = $db->getInfo(1003)['infocontent'] ?: 90;
             //获取赛事下 待审核 滚球投注
             $where = [
-                ['match_id','=',$match_id],
-                ['roll_ratify','=',2]
+                ['match_id', '=', $match_id],
+                ['roll_ratify', '=', 2]
             ];
-            $order_data = self::where($where)->SELECT('id','account_name','account_identity','order_id','money_time','roll_ratify','money','gain_money')->get()->toArray();
-            if(!empty($order_data)){
+            $order_data = self::where($where)->SELECT('id', 'account_name', 'account_identity', 'order_id', 'money_time', 'roll_ratify', 'money', 'gain_money')->get()->toArray();
+            if (!empty($order_data)) {
                 //获取审核不通过订单 订单号
                 $order_ids_n = [];
                 //获取审核不通过订单
@@ -973,13 +1058,13 @@ class SportsNoteList extends BaseModel
                 $order_ids_y = [];
                 //获取审核未通过订单 投注人
                 $account_identitys = [];
-                foreach($order_data as $k=>$v){
+                foreach ($order_data as $k => $v) {
                     //投注时间 时间戳
                     $order_time = strtotime($v['money_time']);
-                    foreach($warn_data as $kk=>$vv){
+                    foreach ($warn_data as $kk => $vv) {
                         //危险球时间 时间戳
                         $warn_time = strtotime($vv['find_time']);
-                        if($order_time < $warn_time and ($order_time+$handle_time) > $warn_time){
+                        if ($order_time < $warn_time and ($order_time + $handle_time) > $warn_time) {
                             $order_ids_n[] = $v['order_id'];
                             $account_identitys[] = $v['account_identity'];
                             $order_data_n[] = $v;
@@ -988,138 +1073,140 @@ class SportsNoteList extends BaseModel
                     }
                 }
 
-                if(!empty($order_data)){
-                    foreach($order_data as $k=>$v){
+                if (!empty($order_data)) {
+                    foreach ($order_data as $k => $v) {
                         $order_ids_y[] = $v['order_id'];
                     }
                 }
 
-                if(!empty($order_ids_n)){
+                if (!empty($order_ids_n)) {
                     //在审核时间内订单 审核不通过
-                    self::HandleMoney_v2($account_identitys,$order_ids_n,$order_data_n);
+                    self::HandleMoney_v2($account_identitys, $order_ids_n, $order_data_n);
                 }
-                if(!empty($order_ids_y)){
+                if (!empty($order_ids_y)) {
                     //在审核时间外订单 审核通过
-                    $ret_y = self::whereIn('order_id', $order_ids_y)->update(['roll_ratify' => 1,'use_mark'=>'滚球投注自动审核(危险球)通过']);
+                    $ret_y = self::whereIn('order_id', $order_ids_y)->update(['roll_ratify' => 1, 'use_mark' => '滚球投注自动审核(危险球)通过']);
                     //如果更新数量小于订单数量 则返回异常
-                    if($ret_y < count($order_ids_y))  throw new \Exception( Response::generate('',Response::HANDLE_ORDER_Y_ERR));
+                    if ($ret_y < count($order_ids_y)) throw new \Exception(Response::generate('', Response::HANDLE_ORDER_Y_ERR));
 
                 }
 
             }
-           
+
         }
     }
 
     /**
      * 滚球自动审核 账户资金处理
-     * v1 
+     * v1
      * 当用户下同时只有一个订单退款时 可用
-     * 
+     *
      */
-     public static function HandleMoney($account_identitys=[],$order_ids=[],$orders=[]){
-         //用戶账户金额
-        $account_money = \App\Models\Account_detailed::whereIn('account_identity',$account_identitys)->SELECT('account_identity','available_cash')->get()->toArray();
-		//反水
-        $water_return_money = \App\Models\Money_details::whereIn('trade_id',$order_ids)->where('trade_type', '7')->SELECT('trade_id','money')->get()->toArray();
-
-		if(!empty($orders)){
-			for($i=0;$i<count($orders);$i++){
-				for($a=0;$a<count($account_money);$a++){
-					if($orders[$i]['account_identity'] == $account_money[$a]['account_identity']){
-						$available_cash = $account_money[$a]['available_cash'];
-					}
-				}
-				for($b=0;$b<count($water_return_money);$b++){
-					if($orders[$i]['order_id'] == $water_return_money[$b]['trade_id']){
-						$water_return = $water_return_money[$b]['money'];
-					} else {
-						$water_return = 0;
-					}
+    public static function HandleMoney($account_identitys = [], $order_ids = [], $orders = [])
+    {
+        //用戶账户金额
+        $account_money = \App\Models\Account_detailed::whereIn('account_identity', $account_identitys)->SELECT('account_identity', 'available_cash')->get()->toArray();
+        //反水
+        $water_return_money = \App\Models\Money_details::whereIn('trade_id', $order_ids)->where('trade_type', '7')->SELECT('trade_id', 'money')->get()->toArray();
+
+        if (!empty($orders)) {
+            for ($i = 0; $i < count($orders); $i++) {
+                for ($a = 0; $a < count($account_money); $a++) {
+                    if ($orders[$i]['account_identity'] == $account_money[$a]['account_identity']) {
+                        $available_cash = $account_money[$a]['available_cash'];
+                    }
+                }
+                for ($b = 0; $b < count($water_return_money); $b++) {
+                    if ($orders[$i]['order_id'] == $water_return_money[$b]['trade_id']) {
+                        $water_return = $water_return_money[$b]['money'];
+                    } else {
+                        $water_return = 0;
+                    }
                 }
                 //需退回金额 = 投注金额-反水金额
                 $money = abs($orders[$i]['money'] - $water_return);
                 //用户剩余金额
-				$new_available_cash = $available_cash + $money;
-
-				$models = new \App\Models\Money_details();
-				$models->info_identity = UUID();
-				$models->trade_id = $orders[$i]['order_id'];
-				$models->account_name = $orders[$i]['account_name'];
-				$models->account_identity = $orders[$i]['account_identity'];
-				$models->money = $money;
-				$models->money_time = date("Y-m-d H:i:s", time());
-				if ($new_available_cash > $available_cash) {
-					$models->money_type = '1';
-				} else {
-					$models->money_type = '2';
-				}
-				$models->money_cash = $new_available_cash;
-				$models->trade_type = '25';
-				$models->trade_desc = '滚球投注自动审核(危险球)不通过,退回投注资金:¥'.$money.';订单号:'.$orders[$i]['order_id'].'';
+                $new_available_cash = $available_cash + $money;
+
+                $models = new \App\Models\Money_details();
+                $models->info_identity = UUID();
+                $models->trade_id = $orders[$i]['order_id'];
+                $models->account_name = $orders[$i]['account_name'];
+                $models->account_identity = $orders[$i]['account_identity'];
+                $models->money = $money;
+                $models->money_time = date("Y-m-d H:i:s", time());
+                if ($new_available_cash > $available_cash) {
+                    $models->money_type = '1';
+                } else {
+                    $models->money_type = '2';
+                }
+                $models->money_cash = $new_available_cash;
+                $models->trade_type = '25';
+                $models->trade_desc = '滚球投注自动审核(危险球)不通过,退回投注资金:¥' . $money . ';订单号:' . $orders[$i]['order_id'] . '';
                 $models->status = '1';
-                
+
                 //更新订单数据
-                $ret_order = self::where('id', $orders[$i]['id'])->update(['roll_ratify' => '-1','status' => '2','use_mark'=>'滚球投注自动审核(危险球)不通过']);
-                if($ret_order < 1)  throw new \Exception( Response::generate('',Response::UP_ORDER_ERR));
+                $ret_order = self::where('id', $orders[$i]['id'])->update(['roll_ratify' => '-1', 'status' => '2', 'use_mark' => '滚球投注自动审核(危险球)不通过']);
+                if ($ret_order < 1) throw new \Exception(Response::generate('', Response::UP_ORDER_ERR));
 
                 //更新用户数据
                 $ret_user = \App\Models\Account_detailed::where('account_identity', $orders[$i]['account_identity'])->update(['available_cash' => $new_available_cash, 'cash' => $new_available_cash]);
-                if($ret_user < 1)  throw new \Exception( Response::generate('',Response::UP_USER_ERR));
+                if ($ret_user < 1) throw new \Exception(Response::generate('', Response::UP_USER_ERR));
 
                 //更新用户资金数据
-                if(!$models->save()) throw new \Exception( Response::generate('',Response::UP_MONEY_ERR));
-				
-			}
+                if (!$models->save()) throw new \Exception(Response::generate('', Response::UP_MONEY_ERR));
+
+            }
         }
-        
+
     }
 
     /**
      * 滚球自动审核 账户资金处理
-     * v2 
+     * v2
      * 处理一个用户下 多个注单退款时的 余额计算
      */
-    public static function HandleMoney_v2($account_identitys=[],$order_ids=[],$orders=[]){
-       
+    public static function HandleMoney_v2($account_identitys = [], $order_ids = [], $orders = [])
+    {
+
         //获取  用户 初始余额
-        $account_money = \App\Models\Account_detailed::whereIn('account_identity',$account_identitys)->SELECT('account_identity','available_cash')->get()->toArray();
+        $account_money = \App\Models\Account_detailed::whereIn('account_identity', $account_identitys)->SELECT('account_identity', 'available_cash')->get()->toArray();
         //获取 指定注单 反水金额
-        $water_return_money = \App\Models\Money_details::whereIn('trade_id',$order_ids)->where('trade_type', '7')->SELECT('trade_id','money')->get()->toArray();
+        $water_return_money = \App\Models\Money_details::whereIn('trade_id', $order_ids)->where('trade_type', '7')->SELECT('trade_id', 'money')->get()->toArray();
 
-        if(!empty($account_money) and !empty($orders) and !empty($water_return_money)){
+        if (!empty($account_money) and !empty($orders) and !empty($water_return_money)) {
             //拼接每个注单 反水
-            foreach($orders as $k=>$v){
-                $v['fanshui'] = self::getFanshui($v['order_id'],$water_return_money);
+            foreach ($orders as $k => $v) {
+                $v['fanshui'] = self::getFanshui($v['order_id'], $water_return_money);
                 $orders[$k] = $v;
 
             }
 
-            foreach($account_money as $k=>$v){
+            foreach ($account_money as $k => $v) {
                 //默认 余额 0
                 $account_identity = 0;
-                foreach($orders as $kk=>$vv){
+                foreach ($orders as $kk => $vv) {
                     //计算当前余额
-                    if($v['account_identity'] == $vv['account_identity']){
+                    if ($v['account_identity'] == $vv['account_identity']) {
                         //第一个注单 获取用户初始余额
-                        if($account_identity == 0){
+                        if ($account_identity == 0) {
                             //当前注单余额
                             $vv['available_cash'] = $v['available_cash'];
                             //当前注单退款后的余额
-                            $account_identity = $v['available_cash']+$vv['money']-$vv['fanshui'];
-                        }else{//其他 获取 上个注单处理后的余额
+                            $account_identity = $v['available_cash'] + $vv['money'] - $vv['fanshui'];
+                        } else {//其他 获取 上个注单处理后的余额
                             $vv['available_cash'] = $account_identity;
-                            $account_identity = $account_identity+$vv['money']-$vv['fanshui'];
+                            $account_identity = $account_identity + $vv['money'] - $vv['fanshui'];
                         }
                         $orders[$kk] = $vv;
                     }
                 }
             }
 
-            foreach($orders as $k=>$v){
-                 //需退回金额 = 投注金额-反水金额
+            foreach ($orders as $k => $v) {
+                //需退回金额 = 投注金额-反水金额
                 $money = abs($v['money'] - $v['fanshui']);
-                 //用户剩余金额
+                //用户剩余金额
                 $new_available_cash = $v['available_cash'] + $money;
                 $models = new \App\Models\Money_details();
                 $models->info_identity = UUID();
@@ -1129,35 +1216,36 @@ class SportsNoteList extends BaseModel
                 $models->money = $money;
                 $models->money_time = date("Y-m-d H:i:s", time());
                 $models->money_type = '1';
-                
+
                 $models->money_cash = $new_available_cash;
                 $models->trade_type = '25';
-                $models->trade_desc = '滚球投注自动审核(危险球)不通过,退回投注资金:¥'.$money.';订单号:'.$v['order_id'].'';
+                $models->trade_desc = '滚球投注自动审核(危险球)不通过,退回投注资金:¥' . $money . ';订单号:' . $v['order_id'] . '';
                 $models->status = '1';
-               
+
                 //更新订单数据
-                $ret_order = self::where('id', $v['id'])->update(['roll_ratify' => '-1','status' => '2','use_mark'=>'滚球投注自动审核(危险球)不通过']);
-                if($ret_order < 1)  throw new \Exception( Response::generate('',Response::UP_ORDER_ERR));
+                $ret_order = self::where('id', $v['id'])->update(['roll_ratify' => '-1', 'status' => '2', 'use_mark' => '滚球投注自动审核(危险球)不通过']);
+                if ($ret_order < 1) throw new \Exception(Response::generate('', Response::UP_ORDER_ERR));
 
                 //更新用户数据
                 $ret_user = \App\Models\Account_detailed::where('account_identity', $v['account_identity'])->update(['available_cash' => $new_available_cash, 'cash' => $new_available_cash]);
-                if($ret_user < 1)  throw new \Exception( Response::generate('',Response::UP_USER_ERR));
+                if ($ret_user < 1) throw new \Exception(Response::generate('', Response::UP_USER_ERR));
 
                 //更新用户资金数据
-                if(!$models->save()) throw new \Exception( Response::generate('',Response::UP_MONEY_ERR));
+                if (!$models->save()) throw new \Exception(Response::generate('', Response::UP_MONEY_ERR));
 
             }
         }
-   }
-
-   /**
-    * 获取注单 反水金额
-    * $order_id 订单id str
-    * $fanshuiData 反水数据 arr
-    */
-    public static function getFanshui($order_id='',$fanshuiData=[]){
-        foreach($fanshuiData as $k=>$v){
-            if($v['trade_id'] == $order_id){
+    }
+
+    /**
+     * 获取注单 反水金额
+     * $order_id 订单id str
+     * $fanshuiData 反水数据 arr
+     */
+    public static function getFanshui($order_id = '', $fanshuiData = [])
+    {
+        foreach ($fanshuiData as $k => $v) {
+            if ($v['trade_id'] == $order_id) {
                 $fanshui = $v['money'];
             }
         }

+ 3 - 1
datainf/logic/HttpServerDataInf.php

@@ -80,7 +80,7 @@ class HttpServerDataInf
 
 
         $request_uri = substr($request->server['request_uri'], 1);
-        $urls = ['setLeague', 'setMatch', 'setMatchResult', 'setOdds', 'setOddsCH', 'setBroadCast', 'upMatch', 'setResultExpress', 'setMatchWarn'];
+        $urls = ['setLeague', 'setMatch', 'setMatchResult', 'setOdds', 'setOddsCH', 'setBroadCast', 'upMatch', 'setResultExpress', 'setMatchWarn','HandleOrder'];
 
         if (!in_array($request_uri, $urls)) {
             $data = Response::generate('', 0, '', '无效的url');
@@ -151,6 +151,8 @@ class HttpServerDataInf
                 $ret = DataLogic::getInstance()->setResultExpress($data);
             case 'setMatchWarn':
                 $ret = DataLogic::getInstance()->setMatchWarn($data);
+            case 'HandleOrder':
+                $ret = DataLogic::getInstance()->HandleOrder($data);
             default:
                 $ret = 'false';
                 break;