vali пре 6 година
родитељ
комит
c5d867a6ba

+ 2 - 2
app/Lib/Settlement/Adapter/RulePlus.php

@@ -287,8 +287,8 @@ trait RulePlus
         ];
 
         foreach ($arr as $key => $val) {
-            $tmp_home = intval($val->home);
-            $tmp_guest = intval($val->guest);
+            $tmp_home = intval($val->home_score);
+            $tmp_guest = intval($val->guest_score);
             $tmp_home_rate = intval($val->home_rate);
             $tmp_guest_rate = intval($val->guest_rate);
 

+ 8 - 5
app/Lib/Settlement/Adapter/ZqRule.php

@@ -187,8 +187,9 @@ class ZqRule
     public function goal_size_big($model, $resultModels, $resultRecords)
     {
         $resultModel = $resultModels['0'];
-        $word = $resultModel->all_goal . "(全场)";
-        $returnDatas = $this->zq_inball_bigsmall($resultModel->all_goal, $model->condition, 2, $word);
+        $allscore = intval($resultModel->home_score) + intval($resultModel->guest_score);
+        $word = $allscore . "(全场)";
+        $returnDatas = $this->zq_inball_bigsmall($allscore, $model->condition, 2, $word);
         return $returnDatas;
 
     }
@@ -197,8 +198,9 @@ class ZqRule
     public function goal_size_small($model, $resultModels, $resultRecords)
     {
         $resultModel = $resultModels['0'];
-        $word = $resultModel->all_goal . "(全场)";
-        $returnDatas = $this->zq_inball_bigsmall($resultModel->all_goal, $model->condition, 1, $word);
+        $allscore = intval($resultModel->home_score) + intval($resultModel->guest_score);
+        $word = $allscore . "(全场)";
+        $returnDatas = $this->zq_inball_bigsmall($allscore, $model->condition, 1, $word);
         return $returnDatas;
     }
 
@@ -398,7 +400,8 @@ class ZqRule
     {
         $pos = count($resultModel) - 1;
         $resultModel = $resultModel[$pos];
-        if ($resultModel->all_goal <= 0) {
+        $all_score = intval($resultModel->home_score) + intval($resultModel->guest_score);
+        if ($all_score <= 0) {
             return ['result' => 1, 'matchResult' => ''];
         } else {
             return ['result' => -1, 'matchResult' => ''];

+ 7 - 2
app/Lib/Settlement/SettlementOrder.php

@@ -45,6 +45,11 @@ class SettlementOrder extends SettlementBase
     ///$order_ids 某场比塞全部订单数组, $bettype=2 订单类型: 1单式  2串式(默认),    $settype = 1 结算次数:1首次(默认)  2非首次或重结算
     public function reSettlement($order_ids, $bettype = 2, $settype = 1, $game_code = 0, $match_id = 0)
     {
+        $order_ids = array_unique($order_ids);
+
+        if (intval($match_id) <= 0) {
+            return self::makeData(8, 'matchid不能为空或0!');
+        }
 
         if (!in_array($bettype, [1, 2])) {
             return self::makeData(6, '订单类型参数错误!');
@@ -70,7 +75,7 @@ class SettlementOrder extends SettlementBase
         if ($bettype == 1) {
             $chekArr = $this->Match_check($order_ids, $bettype);
             if (empty($chekArr) || count($chekArr) != 1) {
-                return self::makeData(10, '不同场比赛不能同时结算!'.print_r($order_ids,true));
+                return self::makeData(10, '不同场比赛不能同时结算!' . print_r($order_ids, true));
             }
         }
         $this->match_id = $match_id;
@@ -414,7 +419,7 @@ class SettlementOrder extends SettlementBase
     private function cgStatus($game_code, $match_id)
     {
         DB::table("st_" . $game_code . "_result")->where(['match_id' => $match_id])->update(['status' => 3]);
-        DB::table("st_" . $game_code . "_competition")->where(['match_id' => $match_id])->update(['status' => 3]);
+        DB::table("st_" . $game_code . "_competition")->where(['id' => $match_id])->update(['status' => 3]);
     }
 
 }