瀏覽代碼

重新推送 6/4

彭俊 6 年之前
父節點
當前提交
6b50a49258

二進制
.DS_Store


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

@@ -9,11 +9,6 @@ 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,7 +1,7 @@
 {include file="Application/Home/View/Public/header.blade.php"}
-<script>
-    window.location.href="/web/index.html";
-</script>
+{{--<script>--}}
+    {{--window.location.href="/web/index.html";--}}
+{{--</script>--}}
 <!--游戏-->
 <!--      <div class="Prompt allGame">
            <a class="nv" href="#">全部游戏</a>

+ 3 - 5
Application/Sports/Controller/MatchList.php

@@ -383,13 +383,12 @@ class  MatchList extends Controller {
             //==获取当前可用球类==
             $game = lm('GameType', 'Sports')->where('status',1)->select('game_code','game_name','game_ico_url')->get()->toArray();
 
-            //获取 不同状态的查询条件
-            $where = $this->commonFunction->getState($type_code);
-
             $gameData = [];
             foreach ($game as $key=>$type){
+                $matchModel = $this->commonFunction->getModels($type['game_code']);
+                //获取 不同状态的查询条件
+                $where = $this->commonFunction->getState($type_code,$matchModel['model_match']);
                 if($type_code != 'StChampion'){
-                    $matchModel = $this->commonFunction->getModels($type['game_code']);
                     $matchNum = lm($matchModel['model_league'],"Sports")
                         ->join($matchModel['model_match'],$matchModel['model_match'].'.lg_id',$matchModel['model_league'].'.lg_id')
                         ->where($matchModel['model_match'].'.source',$this->source['source'])
@@ -401,7 +400,6 @@ class  MatchList extends Controller {
                         $gameData[] = $type;
                     }
                 }else{
-                    $matchModel = $this->commonFunction->getModels($type['game_code']);
                     $matchNum = lm($matchModel['model_odds'], 'Sports')
                         ->where($this->source)
                         ->where($where)

+ 62 - 35
Application/Sports/Controller/MatchListWeb.php

@@ -28,8 +28,9 @@ class MatchListWeb extends Controller{
     public function gameList(){
 
         $type = $_REQUEST['type'];//状态代码
-        $game_code= $_REQUEST['game_code'];//球类代码
-        $p_code= $_REQUEST['p_code'];//父级玩法代码
+        $game_code = $_REQUEST['game_code'];//球类代码
+        $p_code = $_REQUEST['p_code'];//父级玩法代码
+        $time = $_REQUEST['match_date'];//时间条件
 
         try {
             if(empty($type) ){
@@ -40,16 +41,16 @@ class MatchListWeb extends Controller{
                     $this->getRollBall($type,$game_code,$p_code);
                     break;
                 case 'StSoon'://即将
-                    $this->Other($type,$game_code,$p_code);
+                    $this->Other($type,$game_code,$p_code,$time);
                     break;
                 case 'StToday'://今日
-                    $this->Other($type,$game_code,$p_code);
+                    $this->Other($type,$game_code,$p_code,$time);
                     break;
                 case 'StMorningPlate'://早盘
-                    $this->Other($type,$game_code,$p_code);
+                    $this->Other($type,$game_code,$p_code,$time);
                     break;
                 case 'StStringScene'://串场
-                    $this->Other($type,$game_code,$p_code);
+                    $this->Other($type,$game_code,$p_code,$time);
                     break;
                 default:
                     throw new \Exception(Render([], '10002', lang('Tips','Sports')->get('PARAM_ERROR')));
@@ -70,30 +71,11 @@ class MatchListWeb extends Controller{
         }
 
         $game = lm('GameType', 'Sports')->select('game_code')->where('status',1)->get()->toArray();
-//        $gameData = [];
-//        foreach ($game as $k=>$v){
-//            if($v['game_code'] !='gj'){
-//                $where = $this->commonFunction->getState($type);
-//                $models = $this->commonFunction->getModels($v['game_code'],1);
-//                $matchNum = lm($models['model_league'],"Sports")
-//                    ->join($models['model_match'],$models['model_match'].'.lg_id',$models['model_league'].'.lg_id')
-//                    ->where($models['model_match'].'.source',$this->source['source'])
-//                    ->where($where)
-//                    ->count("*");
-//                //获取满足状态的球类
-//                if($matchNum != 0){
-//                    $gameData[$v['game_code']] = $matchNum;
-//                }
-//            }
-//        }
-//        $gameData['all_num'] = array_sum($gameData);
-//        $data[] = $gameData;
-//        Render($data, '1', lang('Tips','Sports')->get('success'));
         $gameData = [];
         foreach ($game as $k=>$v){
             if($v['game_code'] !='gj'){
-                $where = $this->commonFunction->getState($type);
                 $models = $this->commonFunction->getModels($v['game_code'],1);
+                $where = $this->commonFunction->getState($type,$models['model_match']);
                 $matchNum = lm($models['model_league'],"Sports")
                     ->join($models['model_match'],$models['model_match'].'.lg_id',$models['model_league'].'.lg_id')
                     ->where($models['model_match'].'.source',$this->source['source'])
@@ -116,10 +98,10 @@ class MatchListWeb extends Controller{
         Render($gameData, '1', lang('Tips','Sports')->get('success'));
     }
     //获取非滚球数据
-    public function Other($type,$game_code,$p_code){
+    public function Other($type,$game_code,$p_code,$time=''){
         //根据球类代码及玩法代码 获取相关赛事赔率数据
         if(!empty($game_code) and !empty($p_code)){
-            $matchData = $this->getMatchData($type,$game_code,$p_code);
+            $matchData = $this->getMatchData($type,$game_code,$p_code,$time);
 
             Render($matchData, '1', lang('Tips','Sports')->get('success'));
         }
@@ -143,27 +125,43 @@ class MatchListWeb extends Controller{
     }
 
     //获取赛事数据
-    public function getMatchData($type,$game_code,$p_code=''){
+    public function getMatchData($type,$game_code,$p_code='',$time=''){
         //$p_code 获取具体玩法下的赛事数据
-        $where = $this->commonFunction->getState($type);
         $models = $this->commonFunction->getModels($game_code,1);
+        $where = $this->commonFunction->getState($type,$models['model_match']);
+
         $select = [$models['model_match'].'.match_id'];
+        $timeWhere = [];
         if($p_code){
+            //时间条件
+            if(!empty($time)){
+                if($time == 'other'){
+                    $timeWhere[] = ['match_date','>',date("Y-m-d",strtotime("+1weeks",strtotime(date('Y-m-d',time()))))];
+                }else{
+                    $timeWhere[] = ['match_date',$time];
+                }
+            }
             if($p_code == 'kemp'){
-                $select = [$models['model_league'].'.lg_id',$models['model_league'].'.name_chinese as leagueName','last_time'];
+                $select = [$models['model_league'].'.lg_id',$models['model_league'].'.name_chinese as leagueName','last_time','country_id','area_id'];
             }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'];
+                $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','country_id','area_id'];
             }
         }
+        //国家数据
+        $country = lm('st_country',"Sports")
+            ->select('country_id','name_chinese')
+            ->get()->toArray();
 
+        //赛事数据
         $matchNum = lm($models['model_league'],"Sports")
             ->join($models['model_match'],$models['model_match'].'.lg_id',$models['model_league'].'.lg_id')
-//            ->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')
             ->select($select)
             ->where($models['model_match'].'.source',$this->source['source'])
             ->where($where)
+            ->where($timeWhere)
             ->get()->toArray();
 
+        //赔率数据
         $oddsCodeNum = $this->getOddsData($game_code,$models['model_odds'],$matchNum,$p_code);
         if($p_code){
             $match_odds = [];
@@ -218,15 +216,34 @@ class MatchListWeb extends Controller{
             foreach ($matchNum as $k=>$v){
                 foreach ($match_odds as $kk=>$vv){
                     if($v['lg_id'] == $vv['lg_id']){
+                        $data[$k]['area_id'] = $v['area_id'];
+                        $data[$k]['country_id'] = $v['country_id'];
                         $data[$k]['lg_id'] = $v['lg_id'];
                         $data[$k]['leagueName'] = $v['leagueName'];
                         $data[$k]['matchData'][] = $vv;
                     }
                 }
             }
-            //去重
-            $data = $this->uniquArr($data,'lg_id');
+            //赛事详细数据 去重
+            $matchData = $this->uniquArr($data,'lg_id');
+
+            //获取国家联赛列表
+            $leagueList = [];
+            foreach ($country as $k=>$v){
+                foreach ($matchData as $kk=>$vv){
+                    if($v['country_id'] == $vv['country_id']){
+                        //联赛下赛事数量
+                        $vv['matchNum'] = count($vv['matchData']);
+                        unset($vv['matchData']);
+                        $v['lg_list'][] = $vv;
+                        $leagueList[$k] = $v;
+                    }
+                }
+            }
+            sort($leagueList);
 
+            //国家-联赛列表
+            $data = [$matchData,$leagueList];
             return $data;
         }
         return $oddsCodeNum;
@@ -364,4 +381,14 @@ class MatchListWeb extends Controller{
         }
         return $result;
     }
+
+    //获取直播数据
+    public function getBroadcast(){
+         $data = lm('st_broadcast',"Sports")
+             ->select('id','showid','shower','league_name','game_type','host_team','guest_team','start_time','doing')
+             ->get()
+             ->toArray();
+
+        Render($data, '1', lang('Tips','Sports')->get('success'));
+    }
 }

+ 14 - 0
Application/Sports/Model/St_bq_broadcast.php

@@ -0,0 +1,14 @@
+<?php
+namespace App\Sports\Model;
+
+use \System\Model;
+
+/**
+ * Class Account
+ * @package App\Sports\Model
+ * 棒球 直播数据
+ */
+class St_bq_broadcast extends Model
+{
+    protected $table = 'st_bq_broadcast';
+}

+ 14 - 0
Application/Sports/Model/St_broadcast.php

@@ -0,0 +1,14 @@
+<?php
+namespace App\Sports\Model;
+
+use \System\Model;
+
+/**
+ * Class Account
+ * @package App\Sports\Model
+ * 直播数据
+ */
+class St_broadcast extends Model
+{
+    protected $table = 'st_broadcast';
+}

+ 14 - 0
Application/Sports/Model/St_lq_broadcast.php

@@ -0,0 +1,14 @@
+<?php
+namespace App\Sports\Model;
+
+use \System\Model;
+
+/**
+ * Class Account
+ * @package App\Sports\Model
+ * 篮球 直播数据
+ */
+class St_lq_broadcast extends Model
+{
+    protected $table = 'st_lq_broadcast';
+}

+ 14 - 0
Application/Sports/Model/St_wq_broadcast.php

@@ -0,0 +1,14 @@
+<?php
+namespace App\Sports\Model;
+
+use \System\Model;
+
+/**
+ * Class Account
+ * @package App\Sports\Model
+ * 网球 直播数据
+ */
+class St_wq_broadcast extends Model
+{
+    protected $table = 'st_wq_broadcast';
+}

+ 14 - 0
Application/Sports/Model/St_zq_broadcast.php

@@ -0,0 +1,14 @@
+<?php
+namespace App\Sports\Model;
+
+use \System\Model;
+
+/**
+ * Class Account
+ * @package App\Sports\Model
+ * 足球 直播数据
+ */
+class St_zq_broadcast extends Model
+{
+    protected $table = 'st_zq_broadcast';
+}

+ 1 - 1
Application/Sports/Model/St_zq_league.php

@@ -74,7 +74,7 @@ class St_zq_league extends Model
             ->join($model_match,$model_match.'.lg_id',$model_league.'.lg_id')
             ->select($model_league.'.lg_id',$model_league.'.name_chinese as leagueName',$model_match.'.id',$model_match.'.match_id',$model_match.'.status',$model_match.'.match_date',$model_match.'.match_time',$model_match.'.us_time',$model_match.'.is_morningplate',$model_match.'.is_stringscene')
             ->where([[$model_league.'.name_chinese','!=','']])
-            ->where($where)
+            ->where([[$model_match.'.status','<',2]])
             ->get()
             ->toarray();
 

+ 2 - 2
Biz/Match/GetOddsData.php

@@ -144,10 +144,10 @@ class GetOddsData {
                             $query->where($model_odds.'.odds_code','concede_guest');
                         })
                         ->orWhere(function($query)use ($model_odds){
-                            $query->where($model_odds.'.odds_code','goal_size_home');
+                            $query->where($model_odds.'.odds_code','goal_size_big');
                         })
                         ->orWhere(function($query)use ($model_odds){
-                            $query->where($model_odds.'.odds_code','goal_size_guest');
+                            $query->where($model_odds.'.odds_code','goal_size_small');
                         });
                 }
             )

+ 36 - 64
Biz/Match/GetmatchData.php

@@ -1021,74 +1021,46 @@ class GetmatchData {
             ->where($source)
             ->where('lg_id',$lg_id)
             ->first();
-        if(!empty($time)){//早盘 按时间查询
-            if($time == 'other'){//早盘 一周后
-                $matchData = lm($model_match,"Sports")
-                    ->select($model_match.'.match_id',$model_match.'.tag','match_date',$model_match.'.match_time',$model_match.'.home_team',$model_match.'.guest_team')
-                    ->where($source)
-                    ->where($model_match.'.lg_id',$lg_id)
-                    ->where($where)
-                    ->where('match_date','>',date("Y-m-d",strtotime("+1weeks",strtotime(date('Y-m-d',time())))))
-                    ->where(function($query)use ($model_match,$search){
-                        $query->where($model_match.'.home_team','like','%'.$search.'%')
-                            ->orWhere(function($query)use ($model_match,$search) {
-                                $query->where($model_match . '.guest_team', 'like', '%' . $search . '%');
-                            });
-                    })
-                    ->get()
-                    ->toarray();
-            }else{
-                if($time == date('Y-m-d')){//早盘今天
-                    $matchData = lm($model_match,"Sports")
-                        ->select($model_match.'.match_id',$model_match.'.tag','match_date',$model_match.'.match_time',$model_match.'.home_team',$model_match.'.guest_team')
-                        ->where($source)
-                        ->where($model_match.'.lg_id',$lg_id)
-                        ->where('is_morningplate','=',1)
-                        ->where('match_date',$time)
-                        ->where('match_time','>',date("H:i:s", time()))
-                        ->where(function($query)use ($model_match,$search){
-                            $query->where($model_match.'.home_team','like','%'.$search.'%')
-                                ->orWhere(function($query)use ($model_match,$search) {
-                                    $query->where($model_match . '.guest_team', 'like', '%' . $search . '%');
-                                });
-                        })
-                        ->get()
-                        ->toarray();
+//        dd(1213);
+        //根据时间 拼装查询条件
+        $whereTime = [];
+        if(!empty($time)){
+            if($time == 'other'){
+                //其他时间(七天后)
+                $whereTime = [
+                    ['match_date','>',date("Y-m-d",strtotime("+1weeks",strtotime(date('Y-m-d',time()))))],
+                ];
+            }elseif($time == date('Y-m-d')){
+                //今天
+                $whereTime = [
+                    ['is_morningplate','=',1],
+                    ['match_date','=',$time],
+                    ['match_time','>',date("H:i:s", time())]
+                ];
 
-                }else{//早盘 今天以后
-                    $matchData = lm($model_match,"Sports")
-                        ->select($model_match.'.match_id',$model_match.'.tag','match_date',$model_match.'.match_time',$model_match.'.home_team',$model_match.'.guest_team')
-                        ->where($source)
-                        ->where($model_match.'.lg_id',$lg_id)
-                        ->where($where)
-                        ->where('match_date',$time)
-                        ->where(function($query)use ($model_match,$search){
-                            $query->where($model_match.'.home_team','like','%'.$search.'%')
-                                ->orWhere(function($query)use ($model_match,$search) {
-                                    $query->where($model_match . '.guest_team', 'like', '%' . $search . '%');
-                                });
-                        })
-                        ->get()
-                        ->toarray();
-                }
+            }else{
+                //今天以后 七天内
+                $whereTime = [
+                    ['match_date','=',$time]
+                ];
             }
-
-        }else{
-            $matchData = lm($model_match,"Sports")
-                ->select($model_match.'.match_id',$model_match.'.tag','match_date',$model_match.'.match_time',$model_match.'.home_team',$model_match.'.guest_team')
-                ->where($source)
-                ->where($model_match.'.lg_id',$lg_id)
-                ->where($where)
-                ->where(function($query)use ($model_match,$search){
-                    $query->where($model_match.'.home_team','like','%'.$search.'%')
-                        ->orWhere(function($query)use ($model_match,$search) {
-                            $query->where($model_match . '.guest_team', 'like', '%' . $search . '%');
-                        });
-                })
-                ->get()
-                ->toarray();
         }
 
+        $matchData = lm($model_match,"Sports")
+            ->select($model_match.'.match_id',$model_match.'.tag','match_date',$model_match.'.match_time',$model_match.'.home_team',$model_match.'.guest_team')
+            ->where($source)
+            ->where($model_match.'.lg_id',$lg_id)
+            ->where($where)
+            ->where($whereTime)
+            ->where(function($query)use ($model_match,$search){
+                $query->where($model_match.'.home_team','like','%'.$search.'%')
+                    ->orWhere(function($query)use ($model_match,$search) {
+                        $query->where($model_match . '.guest_team', 'like', '%' . $search . '%');
+                    });
+            })
+            ->get()
+            ->toarray();
+
         //获取各球类默认赔率
         $game_code = $_REQUEST['game_code'];
         switch ($game_code) {

+ 3 - 2
_Route/routes.php

@@ -68,9 +68,10 @@ Route::any("/time", function () {
 Route::any("/", function () {
 	checkClose();
 	header('location:/home-index/index');
-//    dd(123);
-//    header("Location:/web/index"); // 首页
 });
+//Route::any("/", function () {
+//    header("Location:/home-web/index"); // 首页
+//});
 
 Route::any("/pay", function () {
 	return appExec("Payment", "Pay", "Index");

二進制
web/.DS_Store