فهرست منبع

追加推送 5/31

彭俊 6 سال پیش
والد
کامیت
6255b77ab8

+ 5 - 0
Application/Home/Controller/Index.php

@@ -9,6 +9,11 @@ namespace App\Home\Controller;
 class Index extends BaseController {
 
 	public function Index() {
+//        \View::addExtension('html','php');
+
+//        echo  View()->file(public_path().'/web/index.html');
+//	    dd(public_path());
+//        header('location:/web/index.html');
 		$this->display();
 	}
 	function redirect(){

+ 3 - 3
Application/Home/View/Index/Index.blade.php

@@ -1,5 +1,7 @@
 {include file="Application/Home/View/Public/header.blade.php"}
-
+<script>
+    window.location.href="/web/index.html";
+</script>
 <!--游戏-->
 <!--      <div class="Prompt allGame">
            <a class="nv" href="#">全部游戏</a>
@@ -82,8 +84,6 @@
                 </div>
             </div>
             <!--登录注册&&中奖滚动结束-->
-
-
             <!--轮播&&投注-->
             <div class="user ya">
                 {literal}

+ 29 - 4
Application/Sports/Controller/MatchList.php

@@ -198,10 +198,35 @@ class  MatchList extends Controller {
         }
 
         //根据赛事ID获取赔率数据
+        $matchData = [];
         foreach($data as $k => $v){
-            $data[$k]['match_info'] = $this->getOdds($v['match_info'],$st_odds);
-            $data[$k]['match_info'] = array_values($data[$k]['match_info']);
+            foreach($v['match_info'] as $kk => $vv){
+                $matchData[] =$vv;
+            }
+        }
+        if($game_code == 'zq'){
+            $matchData = $this->getOddsData->getOddsZQ($matchData,$st_odds,$this->source);
+        }
+        if($game_code == 'lq'){
+            $matchData = $this->getOddsData->getOddsLQ($matchData,$st_odds,$this->source);
+        }
+        if($game_code == 'bq'){
+            $matchData = $this->getOddsData->getOddsBQ($matchData,$st_odds,$this->source);
+        }
+        if($game_code == 'wq'){
+            $matchData = $this->getOddsData->getOddsWQ($matchData,$st_odds,$this->source);
+        }
+        $lgData = [];
+        foreach($data as $k => $v){
+            $v['match_info'] = [];
+            foreach($matchData as $kk=>$vv){
+                if($v['lg_id'] == $vv['lg_id']){
+                    $v['match_info'][] = $vv;
+                }
+            }
+            $data[$k] = $v;
         }
+//        dd($matchData);
         $data = array_values($data);
         Render($data, '1', lang('Tips','Sports')->get('success'));
     }
@@ -795,10 +820,10 @@ class  MatchList extends Controller {
                             $query->where($st_odds.'.odds_code','concede_guest');
                         })
                         ->orWhere(function($query)use ($st_odds){
-                            $query->where($st_odds.'.odds_code','size_home');
+                            $query->where($st_odds.'.odds_code','goal_size_home');
                         })
                         ->orWhere(function($query)use ($st_odds){
-                            $query->where($st_odds.'.odds_code','size_guest');
+                            $query->where($st_odds.'.odds_code','goal_size_guest');
                         });
                 })
                 ->get()->toArray();

+ 50 - 2
Application/Sports/Controller/MatchListWeb.php

@@ -149,7 +149,11 @@ class MatchListWeb extends Controller{
         $models = $this->commonFunction->getModels($game_code,1);
         $select = [$models['model_match'].'.match_id'];
         if($p_code){
-            $select = [$models['model_league'].'.lg_id',$models['model_league'].'.name_chinese as leagueName',$models['model_match'].'.match_id','home_team','guest_team','match_date','match_time','tag'];
+            if($p_code == 'kemp'){
+                $select = [$models['model_league'].'.lg_id',$models['model_league'].'.name_chinese as leagueName','last_time'];
+            }else{
+                $select = [$models['model_league'].'.lg_id',$models['model_league'].'.name_chinese as leagueName',$models['model_match'].'.match_id','home_team','guest_team','match_date','match_time','tag'];
+            }
         }
 
         $matchNum = lm($models['model_league'],"Sports")
@@ -163,6 +167,36 @@ class MatchListWeb extends Controller{
         $oddsCodeNum = $this->getOddsData($game_code,$models['model_odds'],$matchNum,$p_code);
         if($p_code){
             $match_odds = [];
+            if($p_code == 'kemp'){
+                foreach ($oddsCodeNum as $k=>$v){
+                    foreach ($matchNum as $kk => $vv){
+                        if($v['lg_id'] == $vv['lg_id']){
+                            $match_odds[$kk]['lg_id'] = $vv['lg_id'];
+                            $match_odds[$kk]['leagueName'] = $vv['leagueName'];
+                            $match_odds[$kk]['last_time'] = $vv['last_time'];
+                            $match_odds[$kk]['oddsData'][] = $v;
+                        }
+                    }
+                }
+                $gjData = [];
+                foreach ($match_odds as $k=>$v){
+                    //按p_code分组
+                    $p_code=array();
+                    foreach($v['oddsData'] as $kk=>$vv){
+                        $p_code[$vv['p_code']][]=$vv;
+                    }
+
+                    $sd = [];
+                    foreach ($p_code as $k1=>$v1){
+                        foreach ($v1 as $k2=>$v2){
+                            $sd[$v2['p_code']]['last_time'] =$v['last_time'];
+                            $sd[$v2['p_code']][$v2['odds_code']][] = $v2;
+                        }
+                    }
+                    $gjData[] = $sd;
+                }
+                return $gjData;
+            }
             foreach ($oddsCodeNum as $k=>$v){
                 foreach ($matchNum as $kk=>$vv){
                     if($v['match_id'] == $vv['match_id']){
@@ -200,13 +234,27 @@ class MatchListWeb extends Controller{
     //根据match_id获取赔率数据
     public function getOddsData($game_code,$model_odds,$match_ids,$p_code=''){
         $match_id = [];
+        $lg_ids = [];
         foreach ($match_ids as $k => $v){
            $match_id[] = $v['match_id'];
+           $lg_ids[] = $v['lg_id'];
         }
         $select = ['match_id','p_code'];
         $whereOr = [];
         if($p_code){
-            $select = ['match_id','id','p_code','odds_code','condition','odds','odds_only','sort','status'];
+            $select = ['lg_id','match_id','id','p_code','odds_code','condition','odds','odds_only','sort','status','team'];
+            //获取冠军盘口
+            if($p_code == 'kemp'){
+                $whereOr = [['sort','=',0],['type','=',1]];
+                $oddsData = lm($model_odds,"Sports")
+                    ->select($select)
+                    ->whereIn('lg_id', $lg_ids)
+                    ->where('source',$this->source['source'])
+                    ->where($whereOr)
+                    ->get()
+                    ->toArray();
+                return $oddsData;
+            }
             if($p_code == 'concede' and $game_code == 'zq'){
                 $whereOr = [['sort','=',0]];
                 $oddsData = lm($model_odds,"Sports")

+ 6 - 2
Biz/Game/GameLogic.php

@@ -253,7 +253,9 @@ class GameLogic
             $ret2 = $ac->login($username , $this->paras['password']);
 
             if ( isset($ret2['status']) &&  $ret2['status']==1 && isset( $ret2['data']['0']['token'] ) ){
-                return $this->makeret(1,$ret2['msg'],['ret'=>0,'token'=>$ret2['data']['0']['token']]);
+                $t_d = $ret2['data']['0'];
+                $token = urlencode(json_encode(['img_url'=>$t_d['img_url'],'name'=>$t_d['name'],'token'=>$t_d['token'],'cash'=>$t_d['cash']],256));
+                return $this->makeret(1,$ret2['msg'],['ret'=>0,'token'=>$token,'url'=>'http://'.$_SERVER['HTTP_HOST'].'/m/jump.html?token='.$token]);
             }else{
                 return $this->makeret(0,'false',0);
             }
@@ -466,7 +468,9 @@ class GameLogic
         $ret2 = $ac->login($username , $this->paras['password']);
 
         if ( isset($ret2['status']) &&  $ret2['status']==1 && isset( $ret2['data']['0']['token'] ) ){
-            return $this->makeret(1,$ret2['msg'],['ret'=>0,'token'=>$ret2['data']['0']['token']]);
+            $t_d = $ret2['data']['0'];
+            $token = urlencode(json_encode(['img_url'=>$t_d['img_url'],'name'=>$t_d['name'],'token'=>$t_d['token'],'cash'=>$t_d['cash']],256));
+            return $this->makeret(1,$ret2['msg'],['ret'=>0,'token'=>$token,'url'=>'http://'.$_SERVER['HTTP_HOST'].'/m/jump.html?token='.$token]);
         }else{
             return $this->makeret(0,'false',0);
         }

+ 24 - 0
Biz/Match/GetOddsData.php

@@ -128,8 +128,14 @@ class GetOddsData {
         return $list;
     }
     public function getOddsZQ($matchData,$model_odds,$source,$oddsTypeWhere=''){
+        //获取赛事id 集合
+        $match_ids = [];
+        foreach ($matchData as $k=>$v){
+            $match_ids[] = (int)$v['match_id'];
+        }
         $oddsData = lm($model_odds, 'Sports')
             ->select('match_id','id','p_code','odds_code','status','odds','condition','sort','odds_only')
+            ->whereIn('match_id',$match_ids)
             ->where($source)
             ->where(
                 function($query)use ($model_odds){
@@ -206,9 +212,15 @@ class GetOddsData {
         return $list;
     }
     public function getOddsLQ($matchData,$model_odds,$source,$oddsTypeWhere=''){
+        //获取赛事id 集合
+        $match_ids = [];
+        foreach ($matchData as $k=>$v){
+            $match_ids[] = $v['match_id'];
+        }
         $oddsData = lm($model_odds, 'Sports')
             ->select('match_id','id','p_code','odds_code','status','odds','condition','sort','odds_only')
             ->where($source)
+            ->whereIn('match_id',$match_ids)
             ->where(
                 function($query)use ($model_odds){
                     $query->where($model_odds.'.odds_code','concede_home')
@@ -284,9 +296,15 @@ class GetOddsData {
         return $list;
     }
     public function getOddsWQ($matchData,$model_odds,$source,$oddsTypeWhere=''){
+        //获取赛事id 集合
+        $match_ids = [];
+        foreach ($matchData as $k=>$v){
+            $match_ids[] = $v['match_id'];
+        }
         $oddsData = lm($model_odds, 'Sports')
             ->select('match_id','id','p_code','odds_code','status','odds','condition','sort','odds_only')
             ->where($source)
+            ->whereIn('match_id',$match_ids)
             ->where(
                 function($query)use ($model_odds){
                     $query->where($model_odds.'.odds_code','dishes_home')
@@ -355,9 +373,15 @@ class GetOddsData {
         return $list;
     }
     public function getOddsBQ($matchData,$model_odds,$source,$oddsTypeWhere=''){
+        //获取赛事id 集合
+        $match_ids = [];
+        foreach ($matchData as $k=>$v){
+            $match_ids[] = $v['match_id'];
+        }
         $oddsData = lm($model_odds, 'Sports')
             ->select('match_id','id','p_code','odds_code','status','odds','condition','sort','odds_only')
             ->where($source)
+            ->whereIn('match_id',$match_ids)
             ->where(
                 function($query)use ($model_odds){
                     $query->where($model_odds.'.odds_code','capot_home')

+ 2 - 0
_Route/routes.php

@@ -68,6 +68,8 @@ Route::any("/time", function () {
 Route::any("/", function () {
 	checkClose();
 	header('location:/home-index/index');
+//    dd(123);
+//    header("Location:/web/index"); // 首页
 });
 
 Route::any("/pay", function () {