vali 6 gadi atpakaļ
vecāks
revīzija
afb6ba074b
1 mainītis faili ar 13 papildinājumiem un 12 dzēšanām
  1. 13 12
      datainf/logic/HttpServerOnlySet.php

+ 13 - 12
datainf/logic/HttpServerOnlySet.php

@@ -93,11 +93,11 @@ class HttpServerOnlySet
         $ret = $this->redis->connect($this->redisconfig['host'], $this->redisconfig['port']);
         if (!$ret) {
             $this->redis = false;
-            throw  new \Exception("连接redis失败 " . date("Y-m-d H:i:s"));
+            throw  new \Exception("连接redis失败 " . date("Y-m-d H:i:s"), 108);
             return;
         }
         if (!$this->redis->auth($this->redisconfig['passwd'])) {
-            throw  new \Exception("redis auth 失败 " . date("Y-m-d H:i:s"));
+            throw  new \Exception("redis auth 失败 " . date("Y-m-d H:i:s"), 109);
             return;
         }
         $this->redis->select($this->redisconfig['db']);
@@ -117,7 +117,7 @@ class HttpServerOnlySet
 
             if (!$this->DataPre($order_ids, $bettype, $settype, $game_code, $match_id, $change_status)) {
                 goto LABDOLAST;
-                throw new  \Exception('没找到订单信息');
+                throw new  \Exception('没找到订单信息', 110);
             }
 
             $this->UndoSettlement();
@@ -165,7 +165,8 @@ class HttpServerOnlySet
 
         } catch (\Exception $e) {
             $this->PDatas = [];
-            $data = Response::generate('', 10, '', $e->getMessage() . '--' . $e->getFile() . '--' . $e->getLine());
+            //$data = Response::generate('', $e->getCode(), '', $e->getMessage() . '--' . $e->getFile() . '--' . $e->getLine());
+            $data = Response::generate('', $e->getCode(), '', $e->getMessage() . '--' . $e->getLine());
             echo $data . "\n";
 
         }
@@ -190,20 +191,20 @@ class HttpServerOnlySet
         $change_status = isset($paras['change_status']) ? $paras['change_status'] : 0;
 
         if (intval($match_id) <= 0) {
-            throw  new \Exception('赛事ID不能为空!');
+            throw  new \Exception('赛事ID不能为空!', 100);
             return;
         }
 
         if (empty($game_code)) {
-            throw  new \Exception('赛事类型不能为空!');
+            throw  new \Exception('赛事类型不能为空!', 101);
         }
 
         if (!in_array($bettype, [1, 2])) {
-            throw  new \Exception('订单类型参数错误!');
+            throw  new \Exception('订单类型参数错误!', 102);
         }
 
         if (!in_array($settype, [1, 2])) {
-            throw  new \Exception('结算参数错误');
+            throw  new \Exception('结算参数错误', 103);
         }
 
         $this->PDatas['bettype'] = $bettype;
@@ -333,7 +334,7 @@ class HttpServerOnlySet
 
         foreach ($matchDatas as $val) {
             if (!in_array($val->result, [-1, 1, 2, 3, 4])) {
-                throw  new  \Exception('match比赛结果异常或还没有输赢结果->' . $val->id);
+                throw  new  \Exception('match比赛结果异常或还没有输赢结果->' . $val->id, 104);
             }
         }
 
@@ -425,7 +426,7 @@ class HttpServerOnlySet
 
         foreach ($matchDatas as $val) {
             if (!in_array($val->result, [-1, 1, 2, 3, 4])) {
-                throw  new  \Exception('match比赛结果异常或还没有输赢结果->' . $val->id);
+                throw  new  \Exception('match比赛结果异常或还没有输赢结果->' . $val->id, 105);
             }
         }
 
@@ -433,7 +434,7 @@ class HttpServerOnlySet
         $batch_id = $simplexData->batch_id;
         $matchModels = $matchDatas;
         if (count($matchModels) <= 0) {
-            throw  new  \Exception('match 数据异常-' . $batch_id);
+            throw  new  \Exception('match 数据异常-' . $batch_id, 106);
         }
 
 
@@ -449,7 +450,7 @@ class HttpServerOnlySet
             $in_array = [];
             foreach ($matchModels as $val) {
                 if (!in_array($val->result, [-1, 1, 2, 3, 4])) {
-                    throw  new  \Exception('match 比赛结果异常或还没有输赢结果->' . $val->id);
+                    throw  new  \Exception('match 比赛结果异常或还没有输赢结果->' . $val->id, 107);
                 }
 
                 if ($val->result == -1) {