Merge branch 'master' of http://git.njrzwl.cn:3000/wangmingchuan/yanzong
commit
d0b4626262
@ -1,83 +1,86 @@ |
|||||||
<?php |
<?php |
||||||
|
|
||||||
namespace app\common\enum\user; |
namespace app\common\enum\user; |
||||||
|
|
||||||
use app\common\enum\EnumBasics; |
use app\common\enum\EnumBasics; |
||||||
|
|
||||||
class UserTypeEnum extends EnumBasics |
class UserTypeEnum extends EnumBasics |
||||||
{ |
{ |
||||||
// 普通用户 |
// 普通用户 |
||||||
const NORMAL = 10; |
const NORMAL = 10; |
||||||
|
|
||||||
// 会员用户 |
// 会员用户 |
||||||
const MEMBER = 20; |
const MEMBER = 20; |
||||||
|
|
||||||
// 分销商用户 |
// 分销商用户 |
||||||
const DEALER = 30; |
const DEALER = 30; |
||||||
|
|
||||||
// 店长用户 |
// 店长用户 |
||||||
const STORE = 40; |
const STORE = 40; |
||||||
|
|
||||||
/** |
/** |
||||||
* 获取用户类型值 |
* 获取用户类型值 |
||||||
* @return array |
* @return array |
||||||
*/ |
*/ |
||||||
public static function data(): array |
public static function data(): array |
||||||
{ |
{ |
||||||
return [ |
return [ |
||||||
self::NORMAL => [ |
self::NORMAL => [ |
||||||
'name' => '游客', |
'name' => '游客', |
||||||
'value' => self::NORMAL, |
'value' => self::NORMAL, |
||||||
], |
], |
||||||
self::MEMBER => [ |
self::MEMBER => [ |
||||||
'name' => '会员', |
'name' => '会员', |
||||||
'value' => self::MEMBER, |
'value' => self::MEMBER, |
||||||
], |
], |
||||||
self::DEALER => [ |
self::DEALER => [ |
||||||
'name' => '分销商', |
'name' => '分销商', |
||||||
'value' => self::DEALER, |
'value' => self::DEALER, |
||||||
], |
], |
||||||
self::STORE => [ |
self::STORE => [ |
||||||
'name' => '店长', |
'name' => '店长', |
||||||
'value' => self::STORE, |
'value' => self::STORE, |
||||||
] |
] |
||||||
]; |
]; |
||||||
} |
} |
||||||
|
|
||||||
/** |
/** |
||||||
* 根据值获取名称 |
* 根据值获取名称 |
||||||
* @param string $value |
* @param string $value |
||||||
* @return string |
* @return string |
||||||
*/ |
*/ |
||||||
public static function getName(string $value): string |
public static function getName(string $value): string |
||||||
{ |
{ |
||||||
return self::data()[$value]['name']; |
return self::data()[$value]['name']; |
||||||
} |
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static function homeLocation(array $mobile){ |
public static function homeLocation(string $mobile){ |
||||||
|
$datatype = 'txt'; |
||||||
} |
$url = 'https://api.ip138.com/mobile/?mobile='.$mobile.'&datatype='.$datatype; |
||||||
|
$header = array('token:00d5cb1fac5dc5cbfe2ff218292a2dfd33'); |
||||||
public function getData($url,$header){ |
return self::getName($url,$header ); |
||||||
|
} |
||||||
$ch = curl_init(); |
|
||||||
|
public function getData($url,$header){ |
||||||
curl_setopt($ch,CURLOPT_URL,$url); |
|
||||||
|
$curl = curl_init(); |
||||||
curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1); |
|
||||||
|
curl_setopt($curl,CURLOPT_URL,$url); |
||||||
curl_setopt($ch,CURLOPT_HTTPHEADER,$header); |
|
||||||
|
curl_setopt($curl,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1); |
||||||
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); |
|
||||||
|
curl_setopt($curl,CURLOPT_HTTPHEADER,$header); |
||||||
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,3); |
|
||||||
|
curl_setopt($curl,CURLOPT_RETURNTRANSFER,1); |
||||||
$handles = curl_exec($ch); |
|
||||||
|
curl_setopt($curl,CURLOPT_CONNECTTIMEOUT,3); |
||||||
curl_close($ch); |
|
||||||
|
$handles = curl_exec($curl); |
||||||
return $handles; |
|
||||||
} |
curl_close($curl); |
||||||
|
|
||||||
|
return $handles; |
||||||
|
} |
||||||
} |
} |
Loading…
Reference in new issue