Browse Source

调整冠军联赛投注验证

彭俊 6 năm trước cách đây
mục cha
commit
5fd5c57397

+ 4 - 2
Application/Api/Controller/Betorder.php

@@ -41,8 +41,10 @@ class Betorder extends BaseController{
                 $num = $kk+1;
                 $num = $kk+1;
                 //验证联赛是否存在
                 //验证联赛是否存在
                 $this->verify_league($vv['ballId'],(int)$vv['lg_id'],$num);
                 $this->verify_league($vv['ballId'],(int)$vv['lg_id'],$num);
-                //验证赛事是否存在
-                $this->verify_match($vv['ballId'],$vv['match_id'],$num);
+                //验证赛事是否存在,如果match_id = 0 则为冠军联赛赔率,无需验证赛事
+                if($vv['match_id'] > 0){
+                    $this->verify_match($vv['ballId'],$vv['match_id'],$num);
+                }
                 //验证球类代码是否有效
                 //验证球类代码是否有效
                 $this->verify_gameType($vv['ballId'],$num);
                 $this->verify_gameType($vv['ballId'],$num);
                 //验证赛事下赔率玩法是否有效
                 //验证赛事下赔率玩法是否有效

+ 5 - 3
Application/Sports/Model/St_zq_competition.php

@@ -50,14 +50,16 @@ class St_zq_competition extends Model
         //查询 赛事结果记录最新的一条
         //查询 赛事结果记录最新的一条
         $match_ids_str = implode(",", $match_ids);
         $match_ids_str = implode(",", $match_ids);
         $result_record = $models['model_result_record'];
         $result_record = $models['model_result_record'];
-        $sql = "select a.match_id,a.home_score,a.guest_score,a.match_time as a_time,a.match_process from $result_record a,
-(select match_id,max(id) id from $result_record where match_id IN ($match_ids_str) group by match_id)b
-where a.match_id = b.match_id and a.id = b.id ";
+
         //如果是网球
         //如果是网球
         if($result_record == 'st_wq_result_record'){
         if($result_record == 'st_wq_result_record'){
             $sql = "select a.match_id,a.home_player_score,a.guest_player_score,a.match_time as a_time,a.match_process from $result_record a,
             $sql = "select a.match_id,a.home_player_score,a.guest_player_score,a.match_time as a_time,a.match_process from $result_record a,
 (select match_id,max(id) id from $result_record where match_id IN ($match_ids_str) group by match_id)b
 (select match_id,max(id) id from $result_record where match_id IN ($match_ids_str) group by match_id)b
 where a.match_id = b.match_id and a.id = b.id ";
 where a.match_id = b.match_id and a.id = b.id ";
+        }else{
+            $sql = "select a.match_id,a.home_score,a.guest_score,a.match_time as a_time,a.match_process from $result_record a,
+            (select match_id,max(id) id from $result_record where match_id IN ($match_ids_str) group by match_id)b
+            where a.match_id = b.match_id and a.id = b.id ";
         }
         }
         $match_result_record = S ('DB')->select ($sql);
         $match_result_record = S ('DB')->select ($sql);