From 0e60d91ba8cc2c7baae81481a4eda62f03b29a3c Mon Sep 17 00:00:00 2001 From: wanghousheng Date: Mon, 15 Jul 2024 20:50:58 +0800 Subject: [PATCH] 1 --- app/common/enum/user/UserTypeEnum.php | 61 ++++++++++++++------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/app/common/enum/user/UserTypeEnum.php b/app/common/enum/user/UserTypeEnum.php index 116fe575..0443cb5b 100644 --- a/app/common/enum/user/UserTypeEnum.php +++ b/app/common/enum/user/UserTypeEnum.php @@ -30,17 +30,17 @@ class UserTypeEnum extends EnumBasics 'value' => self::NORMAL, ], self::MEMBER => [ - 'name' => '会员', + 'name' => '采购商', 'value' => self::MEMBER, ], self::DEALER => [ - 'name' => '分销商', + 'name' => '服务商', 'value' => self::DEALER, ], - self::STORE => [ - 'name' => '店长', - 'value' => self::STORE, - ] +// self::STORE => [ +// 'name' => '店长', +// 'value' => self::STORE, +// ] ]; } @@ -55,32 +55,33 @@ class UserTypeEnum extends EnumBasics } - - public static function homeLocation(string $mobile){ + public static function homeLocation(string $mobile): string + { $datatype = 'txt'; - $url = 'https://api.ip138.com/mobile/?mobile='.$mobile.'&datatype='.$datatype; + $url = 'https://api.ip138.com/mobile/?mobile=' . $mobile . '&datatype=' . $datatype; $header = array('token:00d5cb1fac5dc5cbfe2ff218292a2dfd33'); - return self::getName($url,$header ); + return self::getName($url, $header); } - public function getData($url,$header){ - - $curl = curl_init(); - - curl_setopt($curl,CURLOPT_URL,$url); - - curl_setopt($curl,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1); - - curl_setopt($curl,CURLOPT_HTTPHEADER,$header); - - curl_setopt($curl,CURLOPT_RETURNTRANSFER,1); - - curl_setopt($curl,CURLOPT_CONNECTTIMEOUT,3); - - $handles = curl_exec($curl); - - curl_close($curl); - - return $handles; - } + public function getData($url, $header) + { + + $curl = curl_init(); + + curl_setopt($curl, CURLOPT_URL, $url); + + curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); + + curl_setopt($curl, CURLOPT_HTTPHEADER, $header); + + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + + curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 3); + + $handles = curl_exec($curl); + + curl_close($curl); + + return $handles; + } } \ No newline at end of file