vali 6 năm trước cách đây
mục cha
commit
4c9f37935b
1 tập tin đã thay đổi với 21 bổ sung7 xóa
  1. 21 7
      app/Lib/Settlement/Adapter/WqRule.php

+ 21 - 7
app/Lib/Settlement/Adapter/WqRule.php

@@ -257,22 +257,27 @@ class WqRule
     {
         $odds_code = $model->odds_code;
         $stand_datas = $this->wq_scoreDatas($resultModel);
-        $all_home = $stand_datas['all']['home'];
-        $all_guest = $stand_datas['all']['guest'];
-        $word = $all_home . '-' . $all_guest . '(比分)';
+
+        $all_home_2 = $stand_datas['bodan2']['home'];
+        $all_guest_2 = $stand_datas['bodan2']['guest'];
+        $all_home_3 = $stand_datas['bodan3']['home'];
+        $all_guest_3 = $stand_datas['bodan3']['guest'];
+
+        $word_2 = $all_home_2 . '-' . $all_guest_2 . '(比分)';
+        $word_3 = $all_home_3 . '-' . $all_guest_3 . '(比分)';
 
         switch ($odds_code) {
             case 'b20_3':
-                $return = $this->bodan_fun($all_home, $all_guest, '2-0', $word);
+                $return = $this->bodan_fun($all_home_2, $all_guest_2, '2-0', $word_2);
                 break;
             case 'b21_3':
-                $return = $this->bodan_fun($all_home, $all_guest, '2-1', $word);
+                $return = $this->bodan_fun($all_home_3, $all_guest_3, '2-1', $word_3);
                 break;
             case 'b02_3':
-                $return = $this->bodan_fun($all_home, $all_guest, '0-2', $word);
+                $return = $this->bodan_fun($all_home_2, $all_guest_2, '0-2', $word_2);
                 break;
             case 'b12_3':
-                $return = $this->bodan_fun($all_home, $all_guest, '1-2', $word);
+                $return = $this->bodan_fun($all_home_3, $all_guest_3, '1-2', $word_3);
                 break;
             default:
                 $return = $this->return_he;
@@ -343,6 +348,8 @@ class WqRule
             'all' => ['home' => 0, 'guest' => 0],         //总赢盘数统计
             'allinning' => ['home' => 0, 'guest' => 0],   //总赢局数统计
             'oneinning' => ['home' => 0, 'guest' => 0],   //第一盘的赢局数统计
+            'bodan3' => ['home' => 0, 'guest' => 0],       //前三盘波胆比分
+            'bodan2' => ['home' => 0, 'guest' => 0],       //前两盘波胆比分
         ];
 
         foreach ($arr as $key => $val) {
@@ -354,6 +361,13 @@ class WqRule
             $return['allinning']['home'] += $tmp_home;
             $return['allinning']['guest'] += $tmp_guest;
 
+            if ($key >= 1 and $key <= 3) {
+                if ($key < 3) {
+                    ($tmp_home > $tmp_guest) ? ($return['bodan2']['home']++) : ($return['bodan2']['guest']++);
+                }
+                ($tmp_home > $tmp_guest) ? ($return['bodan3']['home']++) : ($return['bodan3']['guest']++);
+            }
+
             if ($key == 1) {
                 $return['oneinning']['home'] = $tmp_home;
                 $return['oneinning']['guest'] = $tmp_guest;