orderby('time','desc')->get(); if(!$data){ return -6010000122; } return $data->toArray(); } function getRole($id){ $data=$this->where('id',$id)->first(); if(!$data){ return -7050001204; } return $data->toArray(); } protected function checkIp(){ $ip=GETIP(); if(\App\Models\Setinfo::getIPlimit()<0){ return 1; } if(S('IPLIST')<0) { $ip_list=$this->getCode(); if($ip_list<0){ return 1; } $ips=array(); if(is_array($ip_list) && count($ip_list)>0){ foreach($ip_list as $k=>$v){ $ips[]=trim($v['ip']); } } S('IPLIST',$ips); } if(!is_array(S('IPLIST'))){ return 1; } if(in_array($ip,S('IPLIST'))){ return 1; } return -33333; } }