|
|
@@ -711,22 +711,55 @@ class CommonFunction {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param $type_code
|
|
|
+ * @param $type_code 状态码
|
|
|
+ * @param $model_match 赛事表名
|
|
|
+ * @param $game_code 球类代码
|
|
|
* @return array
|
|
|
* @throws \Exception
|
|
|
* 获取不同状态下的 查询条件
|
|
|
*/
|
|
|
- function getState($type_code,$model_match = ''){
|
|
|
+ function getState($type_code,$model_match = '',$game_code){
|
|
|
if($model_match == ''){
|
|
|
switch ($type_code){
|
|
|
case 'StRollBall'://滚球 正在进行
|
|
|
- $where = [
|
|
|
- // ['is_rollball','=',1],
|
|
|
- ['status','<','2'],
|
|
|
- ['match_date','=',date("Y-m-d")],
|
|
|
- ['match_time','>',date("H:i:s", time()-(90*60))],
|
|
|
- ['match_time','<',date("H:i:s", time())]
|
|
|
- ];
|
|
|
+ //追加不同球类的滚球时间
|
|
|
+ if($game_code == 'zq'){
|
|
|
+ $where = [
|
|
|
+ // ['is_rollball','=',1],
|
|
|
+ ['status','<','2'],
|
|
|
+ ['match_date','=',date("Y-m-d")],
|
|
|
+ ['match_time','>',date("H:i:s", time()-(90*60))],
|
|
|
+ ['match_time','<',date("H:i:s", time())]
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ if($game_code == 'lq'){
|
|
|
+ $where = [
|
|
|
+ // ['is_rollball','=',1],
|
|
|
+ ['status','<','2'],
|
|
|
+ ['match_date','=',date("Y-m-d")],
|
|
|
+ ['match_time','>',date("H:i:s", time()-(90*60))],
|
|
|
+ ['match_time','<',date("H:i:s", time())]
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ if($game_code == 'wq'){
|
|
|
+ $where = [
|
|
|
+ // ['is_rollball','=',1],
|
|
|
+ ['status','<','2'],
|
|
|
+ ['match_date','=',date("Y-m-d")],
|
|
|
+ ['match_time','>',date("H:i:s", time()-(300*60))],
|
|
|
+ ['match_time','<',date("H:i:s", time())]
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ if($game_code == 'bq'){
|
|
|
+ $where = [
|
|
|
+ // ['is_rollball','=',1],
|
|
|
+ ['status','<','2'],
|
|
|
+ ['match_date','=',date("Y-m-d")],
|
|
|
+ ['match_time','>',date("H:i:s", time()-(300*60))],
|
|
|
+ ['match_time','<',date("H:i:s", time())]
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
break;
|
|
|
case 'StSoon'://即将 今日两小时内开始
|
|
|
$where = [
|
|
|
@@ -788,13 +821,44 @@ class CommonFunction {
|
|
|
}else{
|
|
|
switch ($type_code){
|
|
|
case 'StRollBall'://滚球 正在进行
|
|
|
- $where = [
|
|
|
- // [$model_match.'.is_rollball','=',1],
|
|
|
- [$model_match.'.status','<','2'],
|
|
|
- [$model_match.'.match_date','=',date("Y-m-d")],
|
|
|
- [$model_match.'.match_time','>',date("H:i:s", time()-(90*60))],
|
|
|
- [$model_match.'.match_time','<',date("H:i:s", time())]
|
|
|
- ];
|
|
|
+ //追加不同球类的滚球时间
|
|
|
+ if($game_code == 'zq'){
|
|
|
+ $where = [
|
|
|
+ // [$model_match.'.is_rollball','=',1],
|
|
|
+ [$model_match.'.status','<','2'],
|
|
|
+ [$model_match.'.match_date','=',date("Y-m-d")],
|
|
|
+ [$model_match.'.match_time','>',date("H:i:s", time()-(90*60))],
|
|
|
+ [$model_match.'.match_time','<',date("H:i:s", time())]
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ if($game_code == 'lq'){
|
|
|
+ $where = [
|
|
|
+ // [$model_match.'.is_rollball','=',1],
|
|
|
+ [$model_match.'.status','<','2'],
|
|
|
+ [$model_match.'.match_date','=',date("Y-m-d")],
|
|
|
+ [$model_match.'.match_time','>',date("H:i:s", time()-(90*60))],
|
|
|
+ [$model_match.'.match_time','<',date("H:i:s", time())]
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ if($game_code == 'wq'){
|
|
|
+ $where = [
|
|
|
+ // [$model_match.'.is_rollball','=',1],
|
|
|
+ [$model_match.'.status','<','2'],
|
|
|
+ [$model_match.'.match_date','=',date("Y-m-d")],
|
|
|
+ [$model_match.'.match_time','>',date("H:i:s", time()-(300*60))],
|
|
|
+ [$model_match.'.match_time','<',date("H:i:s", time())]
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ if($game_code == 'bq'){
|
|
|
+ $where = [
|
|
|
+ // [$model_match.'.is_rollball','=',1],
|
|
|
+ [$model_match.'.status','<','2'],
|
|
|
+ [$model_match.'.match_date','=',date("Y-m-d")],
|
|
|
+ [$model_match.'.match_time','>',date("H:i:s", time()-(300*60))],
|
|
|
+ [$model_match.'.match_time','<',date("H:i:s", time())]
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
break;
|
|
|
case 'StSoon'://即将 今日两小时内开始
|
|
|
$where = [
|