Bladeren bron

新增推送 7/3

彭俊 6 jaren geleden
bovenliggende
commit
cf7ee29adc

+ 12 - 5
app/Http/Controllers/Api/WriteSportsController.php

@@ -265,7 +265,7 @@ class WriteSportsController extends BaseController{
                                 'status'=>$data['status'],
                                 'match_date'=>$data['match_date']?:date('Y-m-d'),
                                 'match_time'=>$data['match_time']?:date('H:i:s'),
-                                'tag'=>$data['tag']?:0,
+                                // 'tag'=>$data['tag']?:0,
                                 'is_rollball'=>$data['is_rollball']?:0,
                                 'is_today'=>$data['is_today']?:0,
                                 'is_morningplate'=>$data['is_morningplate']?:0,
@@ -442,6 +442,8 @@ class WriteSportsController extends BaseController{
             $s_lg_id = $getData['lg_id'];
             //获取源数据赛事ID
             $s_match_id = $getData['match_id'];
+            //获取赔率所属赛事 tag 值 玩法数量
+            $tag = $getData['tag'];
 
             //获取球类名称
             $gameName = gameModel::getGameName($game_code);
@@ -450,6 +452,11 @@ class WriteSportsController extends BaseController{
             $lg_id = $this->leagueVerify($models,$s_lg_id,$source,$gameName);
             $match_id = $this->matchVerify($models,$s_match_id,$source,$gameName);
 
+            //更新赛事 tag 值
+            $upMatch = $models['model_match']::where(['id'=>$match_id])
+            ->update(['tag'=>$tag,'utime'=>date('Y-m-d H:i:s')]);
+            if($upMatch < 1) throw new \Exception(Response::generate($gameName.'赛事-match_id:'.$s_match_id.';',Response::UPMATCHTAG_ERROR)) ;
+
             //获取 赔率数据
             $oddsData = $getData['data'];
             if(!empty($oddsData)){
@@ -1379,7 +1386,7 @@ class WriteSportsController extends BaseController{
                 "match_winer"=> $data['match_winer']?:'',
                 "match_time"=> $data['match_time']?:0,
                 "match_process"=> $data['match_process']?:'',
-                "tag"=> $data['tag']?:0,
+                // "tag"=> $data['tag']?:0,
                 "match_id"=> $match_id,
                 "update_time"=>date('Y-m-d H:i:s')
             ];
@@ -1400,7 +1407,7 @@ class WriteSportsController extends BaseController{
                 "match_winer"=> $data['match_winer']?:'',
                 "match_time"=> $data['match_time']?:0,
                 "match_process"=> $data['match_process']?:'',
-                "tag"=> $data['tag']?:0,
+                // "tag"=> $data['tag']?:0,
                 "match_id"=> $match_id,
                 "update_time"=>date('Y-m-d H:i:s')
             ];
@@ -1427,7 +1434,7 @@ class WriteSportsController extends BaseController{
                 "update_time"=>date('Y-m-d H:i:s'),
                 "match_time"=>$data['match_time']?:0,
                 "match_process"=>$data['match_process']?:'',
-                "tag"=>$data['tag']?:0,
+                // "tag"=>$data['tag']?:0,
                 "match_id"=>$match_id,
                 "result_mark" =>$data['result_mark']?:'',
             ];
@@ -1448,7 +1455,7 @@ class WriteSportsController extends BaseController{
                 "match_winer"=> $data['match_winer']?:'',
                 "match_time"=> $data['match_time']?:0,
                 "match_process"=> $data['match_process']?:'',
-                "tag"=> $data['tag']?:0,
+                // "tag"=> $data['tag']?:0,
                 "match_id"=> $match_id,
                 "all_inning"=>$data['all_inning']?:9,
                 "update_time"=>date('Y-m-d H:i:s'),

+ 3 - 0
app/Http/Response/Response.php

@@ -37,6 +37,8 @@ class Response
 
     //联赛uuid 为空
     const LG__UUID_NULL = 10033;
+    //更新赛事tag
+    const UPMATCHTAG_ERROR = 10034;
 
 
     private static $errorMsgs = [
@@ -64,6 +66,7 @@ class Response
         //===更新赛事状态===
         self::MATCHID_NULL =>'未获取到相关赛事',
         self::UPSTATUS_ERROR =>'赛事状态更新失败',
+        self::UPMATCHTAG_ERROR =>'赛事tag更新失败',
         //===更新赔率状态===
         self::ODDS_SOLE_ERR =>'更新赔率状态失败',
         //===获取用户 token===

+ 40 - 0
app/Lib/Settlement/Adapter/RulePlus.php

@@ -656,7 +656,47 @@ trait RulePlus
 
     //首个进球方式  sw_FG
     public function onewaygoal($resultModels, $model, $type, $allword){
+        $firststye = json_decode($resultModels->first_score,true)['scoretype'];//最先进球
 
+        if($model->odds_code == $type){
+            if($firststye == "射门"){
+                return ['result' => 1, 'matchResult' => $allword];
+            }else{
+                return ['result' => -1, 'matchResult' => $allword];
+            }
+        }else if($model->odds_code == $type){
+            if($firststye == "头球"){
+                return ['result' => 1, 'matchResult' => $allword];
+            }else{
+                return ['result' => -1, 'matchResult' => $allword];
+            }
+        }else if($model->odds_code == $type){
+            if($firststye == "无进球"){
+                return ['result' => 1, 'matchResult' => $allword];
+            }else{
+                return ['result' => -1, 'matchResult' => $allword];
+            }
+        }else if($model->odds_code == $type){
+            if($firststye == "点球"){
+                return ['result' => 1, 'matchResult' => $allword];
+            }else{
+                return ['result' => -1, 'matchResult' => $allword];
+            }
+        }else if($model->odds_code == $type){
+            if($firststye == "任意球"){
+                return ['result' => 1, 'matchResult' => $allword];
+            }else{
+                return ['result' => -1, 'matchResult' => $allword];
+            }
+        }else if($model->odds_code == $type){
+            if($firststye == "乌龙球"){
+                return ['result' => 1, 'matchResult' => $allword];
+            }else{
+                return ['result' => -1, 'matchResult' => $allword];
+            }
+        }else{
+            return ['result' => 100,'matchResult' => "参数不存在"];
+        }
     }
 
     //双重机会&进球大/小  sw_DU 

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

@@ -1989,34 +1989,32 @@ class ZqRule
      * @param mixed $resultModels 结果表数据
      * @param mixed $resultRecords 结果记录表数据
      * model--money_buy_match resultModels--st_zq_result resultRecords--st_zq_result_record
-     * @return string  ?????
+     * @return string  
      */
     public function sw_FG($model, $resultModels, $resultRecords)
     {
         $resultModels = $resultModels['0'];
-        $homeword = $resultModels->home_score . "(主队全场)";
-        $guestword = $resultModels->guest_score . "(客队全场)";
-        $allword = $resultModels->home_score . '-' . $resultModels->guest_score . "(全场)";
+        $word = json_decode($resultModels->first_score,true)['scoretype'] . "(首个进球方式)";
 
         $odds_code = $model->odds_code;
         switch ($odds_code) {
             case "ior_FGS":
-                $returnDatas = $this->onewaygoal($resultModels, $model, ior_FGS, $homeword);
+                $returnDatas = $this->onewaygoal($resultModels, $model, ior_FGS, $word);
                 break;
             case "ior_FGH":
-                $returnDatas = $this->onewaygoal($resultModels, $model, ior_FGH, $homeword);
+                $returnDatas = $this->onewaygoal($resultModels, $model, ior_FGH, $word);
                 break;
             case "ior_FGN":
-                $returnDatas = $this->onewaygoal($resultModels, $model, ior_FGN, $guestword);
+                $returnDatas = $this->onewaygoal($resultModels, $model, ior_FGN, $word);
                 break;
             case "ior_FGP":
-                $returnDatas = $this->onewaygoal($resultModels, $model, ior_FGP, $guestword);
+                $returnDatas = $this->onewaygoal($resultModels, $model, ior_FGP, $word);
                 break;
             case "ior_FGF":
-                $returnDatas = $this->onewaygoal($resultModels, $model, ior_FGF, $allword);
+                $returnDatas = $this->onewaygoal($resultModels, $model, ior_FGF, $word);
                 break;
             case "ior_FGO":
-                $returnDatas = $this->onewaygoal($resultModels, $model, ior_FGO, $allword);
+                $returnDatas = $this->onewaygoal($resultModels, $model, ior_FGO, $word);
                 break;
             default:
                 $returnDatas = ['result' => 2, 'matchResult' => '(玩法无规则异常)-' . $odds_code];

+ 1 - 0
app/Models/Comendnotice.php

@@ -12,6 +12,7 @@ class Comendnotice extends BaseModel {
 
     protected $table = 'comendnotice';
     public $timestamps = false;
+    protected $fillable=['status','pcount','logs','game_code','match_id','result','done_time','start_time','ctime'];
 
     //添加赛事结束纪录
 	function addcomendnotice($match_id,$type){