vali 6 years ago
parent
commit
4267fe65d2
1 changed files with 33 additions and 5 deletions
  1. 33 5
      app/Lib/Settlement/Adapter/WqRule.php

+ 33 - 5
app/Lib/Settlement/Adapter/WqRule.php

@@ -57,6 +57,12 @@ class WqRule
             case 'cg_2':
                 $return = $this->wq_gj_sine($home_team, $guest_team, $stand_datas['list']['2'], 2);
                 break;
+            case 'ch_3':
+                $return = $this->wq_gj_sine($home_team, $guest_team, $stand_datas['list']['3'], 1);
+                break;
+            case 'cg_3':
+                $return = $this->wq_gj_sine($home_team, $guest_team, $stand_datas['list']['3'], 2);
+                break;
             default:
                 $return = $this->return_he;
                 break;
@@ -112,6 +118,26 @@ class WqRule
             case 'ldg':
                 $return = $this->zq_letball($guest_score - $home_score, $condition, $guest_score . '-' . $guest_score . ('总盘'));
                 break;
+            case 'ldh_1':
+                $tmp_home = intval($stand_datas['list']['1']->home_score);
+                $tmp_guest = intval($stand_datas['list']['1']->guest_score);
+                $return = $this->zq_letball($tmp_home - $tmp_guest, $condition, $tmp_home . '-' . $tmp_guest . ('第一盘'));
+                break;
+            case 'ldg_1':
+                $tmp_home = intval($stand_datas['list']['1']->home_score);
+                $tmp_guest = intval($stand_datas['list']['1']->guest_score);
+                $return = $this->zq_letball($tmp_guest - $tmp_home, $condition, $tmp_home . '-' . $tmp_guest . ('第一盘'));
+                break;
+            case 'ldh_2':
+                $tmp_home = intval($stand_datas['list']['2']->home_score);
+                $tmp_guest = intval($stand_datas['list']['2']->guest_score);
+                $return = $this->zq_letball($tmp_home - $tmp_guest, $condition, $tmp_home . '-' . $tmp_guest . ('第二盘'));
+                break;
+            case 'ldg_2':
+                $tmp_home = intval($stand_datas['list']['2']->home_score);
+                $tmp_guest = intval($stand_datas['list']['2']->guest_score);
+                $return = $this->zq_letball($tmp_home - $tmp_guest, $condition, $tmp_home . '-' . $tmp_guest . ('第二盘'));
+                break;
             default:
                 $return = $this->return_he;
                 break;
@@ -263,15 +289,13 @@ class WqRule
 
         $imatch_id = $RecoedModel->match_id;
         $all_datas = json_decode($RecoedModel->inning, true);
-
         $panlen = count($all_datas);
-        if (empty($all_datas) || !in_array($panlen, [3, 5])) {
-            throw new  \Exception("篮球结果数据不正确,( matchid= $imatch_id 主客结果)不能为空或数据量不为3,5");
-            return;
-        }
 
         $return = [];
         for ($i = 1; $i <= $panlen; $i++) {
+            if (!isset($all_datas[$i])) {
+                continue;
+            }
             $tt = clone $RecoedModel;
             $tmpobj = json_decode(json_encode($tt, 256), true);
             $tmpobj['home_score'] = $all_datas[$i]['home'];
@@ -279,6 +303,10 @@ class WqRule
             $tmpobj['winner'] = ($all_datas[$i]['home'] > $all_datas[$i]['guest']) ? 'home' : 'guest';
             $return[$i] = json_decode(json_encode($tmpobj, 256));
         }
+        if (empty($return) || !in_array($return, [3, 5])) {
+            throw new  \Exception("篮球结果数据不正确,( matchid= $imatch_id 主客结果)不能为空或数据量不为3,5");
+            return;
+        }
 
         if ($type == 4) {
             return $return;