where($where)->order('id desc')->paginate($limit); }catch(\Exception $e){ throw new ModelException($e->getMessage()); } return dataReturn($this->sucCode,$this->getMsg,$res); } /** * @param $param * @return array * @throws ModelException */ public function addAdminOptLog($param): array { try{ $ip = request()->ip(); $param['ip'] = $ip; $address = getLocationByIp($ip,2); if(empty($address['province'])){ $area = lang("内网ip"); }else{ $area = $address['province']."-".$address['city']; } $param['addr'] = $area; $param['agent'] = request()->header()['user-agent']; $res = self::create($param); }catch(\Exception $e){ throw new ModelException($e->getMessage()); } return dataReturn($this->sucCode,$this->addMsg,$res->id); } public function getAgentAttr($value): string { return getDeviceInfo($value)['deviceOs']; } }