where($where)->where('expire_time','<',date('Y-m-d H:i:s',time()))->get(); $data=$this->where('match_id',$match_id)->where($where)->get()->toArray(); $num=$this->where('match_id',$match_id)->where('sort',0)->get()->toArray(); $sort = array_column($data,'sort'); array_multisort($sort,SORT_DESC,$data); $data = array_slice($data,0,count($num)); if(!$data < 0){ return -2021052003; } for($i=0;$ifirst(); if(!empty($odds_name)){ $data[$i]['odds_code_cn'] = $odds_name->odds_name; }else{ $data[$i]['odds_code_cn'] = $data[$i]['odds_code']; } $p_name = \App\Models\Matchcode::where('odds_code',$data[$i]['p_code'])->first(); if(!empty($p_name)){ $data[$i]['p_code_cn'] = $p_name->odds_name; }else{ $data[$i]['p_code_cn'] = $data[$i]['p_code']; } } return $data; } }