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;$i