where([['utime','>',date('Y-m-d H:i:s' , strtotime("-1 day"))]]) ->get() ->toArray(); return $Odds_data; } /* * 更新赛事下赔率状态 */ public static function upOddsStatus($model=[],$others_match_id='',$others_lg_id=[],$source='',$odds_only=[]){ $where = []; //普通 赔率 if(!empty($others_match_id) and !empty($source)){ $where = [ ['others_match_id','=',$others_match_id], ['source','=',$source] ]; //获取当前 赛事 所有 赔率only $odds_data = $model['model_odds']::select('odds_only') ->where($where) ->get() ->toArray(); } //冠军联赛 赔率 if(!empty($others_lg_id) and !empty($source)){ //获取当前 赛事 所有 赔率only $odds_data = $model['model_odds']::select('odds_only') ->whereIn('others_lg_id',$others_lg_id) ->where(['source','=',$source]) ->get() ->toArray(); } if(empty($odds_data)) return true; //去除 本次请求的 赔率only if(is_array($odds_data) and !empty($odds_only)){ foreach ($odds_data as $k => $v){ foreach ($odds_only as $kk => $vv){ if($v['odds_only'] == $vv) unset($odds_data[$k]); } } } if(empty($odds_data)) return true; //降维 获取所有only $only = []; if(is_array($odds_data)){ foreach ($odds_data as $k => $v){ $only[] = $v['odds_only']; } } //批量更新 赔率状态 $ds = $model['model_odds']::whereIn('odds_only', $only) ->update(['status' => -1]); if($ds > 0 ) return true; } }