|
|
@@ -233,7 +233,7 @@ class GetmatchData {
|
|
|
->count();
|
|
|
|
|
|
$data[$k]['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')
|
|
|
+ ->select($model_match.'.match_id',$model_match.'.tag','match_date',$model_match.'.match_time',$model_match.'.home_team',$model_match.'.guest_team',$model_match.'.us_time')
|
|
|
->where($source)
|
|
|
->where($model_match.'.lg_id',$v['lg_id'])
|
|
|
->where($where)
|
|
|
@@ -242,11 +242,13 @@ class GetmatchData {
|
|
|
->toarray();
|
|
|
}
|
|
|
|
|
|
+ //获取当前美东时间
|
|
|
+ $s_time = strtotime($this->commonFunction->qgmdate('Y-m-d H:i:s', '', -4));
|
|
|
//获取足球即将默认玩法赔率
|
|
|
if($ret['game_code'] == 'zq'){
|
|
|
foreach($data as $k => $v){
|
|
|
foreach($v['matchData'] as $kk => $vv){
|
|
|
- $wait_time = ceil(((strtotime( $vv['match_time']))-time())/60);
|
|
|
+ $wait_time = ceil(((strtotime( $vv['us_time']))-$s_time)/60);
|
|
|
$data[$k]['matchData'][$kk]['wait_time'] = $wait_time;//追加距离开赛时间
|
|
|
$oddsData= lm($model_match,"Sports")
|
|
|
->leftjoin($model_odds,$model_odds.'.match_id',$model_match.'.match_id')
|
|
|
@@ -281,7 +283,7 @@ class GetmatchData {
|
|
|
|
|
|
//根据 排序 获取 最新让球/大小玩法赔率
|
|
|
$sortData = array_column($oddsData,'sort');
|
|
|
- array_multisort($sortData,SORT_DESC,$oddsData);
|
|
|
+ array_multisort($sortData,SORT_ASC,$oddsData);
|
|
|
|
|
|
$zu = [];
|
|
|
foreach ($oddsData as $key1 =>$item1){
|
|
|
@@ -302,14 +304,62 @@ class GetmatchData {
|
|
|
$data[$k]['matchData'] = $matchData;
|
|
|
}
|
|
|
}
|
|
|
- //获取网球即将默认玩法赔率
|
|
|
+ //获取篮球即将默认玩法赔率
|
|
|
if($ret['game_code'] == 'lq'){
|
|
|
foreach($data as $k => $v){
|
|
|
- $matchData = $this->getOddsData->getOddsLQ($v['matchData'], $model_odds, $source,$oddsTypeWhere);
|
|
|
- $data[$k]['matchData'] = $matchData;
|
|
|
+ foreach($v['matchData'] as $kk => $vv){
|
|
|
+ $wait_time = ceil(((strtotime( $vv['match_time']))-time())/60);
|
|
|
+ $data[$k]['matchData'][$kk]['wait_time'] = $wait_time;//追加距离开赛时间
|
|
|
+ $oddsData= lm($model_match,"Sports")
|
|
|
+ ->leftjoin($model_odds,$model_odds.'.match_id',$model_match.'.match_id')
|
|
|
+ ->select($model_odds.'.id','odds_only','p_code','odds_code',$model_odds.'.status','odds','condition','sort')
|
|
|
+ ->where($model_match.'.source',$source['source'])
|
|
|
+ ->where([$model_odds.'.match_id' => $vv['match_id'],$model_odds.'.type'=>0])
|
|
|
+// ->where($oddsTypeWhere)
|
|
|
+// ->where($model_odds.'.expire_time','>',date("Y-m-d H:i:s"))
|
|
|
+ ->where(function($query)use ($model_odds){
|
|
|
+ $query->where($model_odds.'.odds_code','concede_home')
|
|
|
+ ->orWhere(function($query)use ($model_odds){
|
|
|
+ $query->where($model_odds.'.odds_code','concede_guest');
|
|
|
+ })
|
|
|
+ ->orWhere(function($query)use ($model_odds){
|
|
|
+ $query->where($model_odds.'.odds_code','total_sizes_big');
|
|
|
+ })
|
|
|
+ ->orWhere(function($query)use ($model_odds){
|
|
|
+ $query->where($model_odds.'.odds_code','total_sizes_small');
|
|
|
+ })
|
|
|
+ ->orWhere(function($query)use ($model_odds){
|
|
|
+ $query->where($model_odds.'.odds_code','capot_home');
|
|
|
+ })
|
|
|
+ ->orWhere(function($query)use ($model_odds){
|
|
|
+ $query->where($model_odds.'.odds_code','capot_dogfall');
|
|
|
+ })
|
|
|
+ ->orWhere(function($query)use ($model_odds){
|
|
|
+ $query->where($model_odds.'.odds_code','capot_guest');
|
|
|
+ });
|
|
|
+ })
|
|
|
+ ->get()
|
|
|
+ ->toarray();
|
|
|
+
|
|
|
+ //根据 排序 获取 最新让球/大小玩法赔率
|
|
|
+ $sortData = array_column($oddsData,'sort');
|
|
|
+ array_multisort($sortData,SORT_ASC,$oddsData);
|
|
|
+
|
|
|
+ $zu = [];
|
|
|
+ foreach ($oddsData as $key1 =>$item1){
|
|
|
+ $zu[$item1['p_code']][] = $item1;
|
|
|
+ }
|
|
|
+ $c_s['concede'] = array_slice($zu['concede'],0,2);//让球 前四条 放入
|
|
|
+ $c_s['total_size'] = array_slice($zu['total_size'],0,2);//让球 前四条 放入
|
|
|
+ $capot = $zu['capot'];//独赢
|
|
|
+
|
|
|
+ $data[$k]['matchData'][$kk]['oddsData'] = [$c_s,$capot];
|
|
|
+ }
|
|
|
+// $matchData = $this->getOddsData->getOddsLQ($v['matchData'], $model_odds, $source,$oddsTypeWhere);
|
|
|
+// $data[$k]['matchData'] = $matchData;
|
|
|
}
|
|
|
}
|
|
|
- //获取网球即将默认玩法赔率
|
|
|
+ //获取棒球即将默认玩法赔率
|
|
|
if($ret['game_code'] == 'bq'){
|
|
|
foreach($data as $k => $v){
|
|
|
$matchData = $this->getOddsData->getOddsBQ($v['matchData'], $model_odds, $source,$oddsTypeWhere);
|
|
|
@@ -867,14 +917,15 @@ class GetmatchData {
|
|
|
*/
|
|
|
public function getAllSoon($source,$where){
|
|
|
$game = lm('GameType', 'Sports')->select('id','game_name','game_code','game_ico_url')->where('status',1)->get()->toArray();
|
|
|
-
|
|
|
+ //获取当前美东时间
|
|
|
+ $s_time = strtotime($this->commonFunction->qgmdate('Y-m-d H:i:s', '', -4));
|
|
|
$data=[];
|
|
|
foreach ($game as $key=>$item){
|
|
|
if($item['game_code'] !='gj'){
|
|
|
$model = $this->commonFunction->getModels($item['game_code']);
|
|
|
|
|
|
$matchData = lm($model['model_match'], 'Sports')
|
|
|
- ->select('match_id','home_team','guest_team','match_time')
|
|
|
+ ->select('match_id','home_team','guest_team','match_time','us_time')
|
|
|
->where($source)
|
|
|
->where($where)
|
|
|
->orderBy('match_time','asc')
|
|
|
@@ -886,7 +937,7 @@ class GetmatchData {
|
|
|
$matchData = array_slice($matchData,0,6);
|
|
|
foreach ($matchData as $key1 => $item1){
|
|
|
//获取等待时间
|
|
|
- $wait_time = ceil(((strtotime($item1['match_time']))-time())/60);
|
|
|
+ $wait_time = ceil(((strtotime($item1['us_time']))-$s_time)/60);
|
|
|
$matchData[$key1]['wait_time'] = $wait_time;
|
|
|
}
|
|
|
|
|
|
@@ -1014,7 +1065,7 @@ class GetmatchData {
|
|
|
|
|
|
//根据 排序 获取 最新让球/大小玩法赔率
|
|
|
$sortData = array_column($oddsData,'sort');
|
|
|
- array_multisort($sortData,SORT_DESC,$oddsData);
|
|
|
+ array_multisort($sortData,SORT_ASC,$oddsData);
|
|
|
|
|
|
$zu = [];
|
|
|
foreach ($oddsData as $key1 =>$item1){
|