UserData.php
1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace LibModels\Web\Home;
use Api\Yohobuy;
use Api\Sign;
use WebPlugin\Helpers;
class UserData extends \LibModels\Wap\Home\UserData
{
/**
* 根据手机号获取用户信息[TODO +cache]
*
* @param string $area
* @param string $mobile
* @return array
*/
public static function getUserInfoByMobile($area, $mobile)
{
$param = Yohobuy::param();
$param['method'] = 'app.passport.userlist';
$param['mobile'] = Helpers::makeMobile($area, $mobile);
$param['debug'] = 'Y';
$param['screen_size'] = '320x568';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param, 3600);
}
/**
* 根据email获取用户信息
*
* @param string $email
* @return array
*/
public static function getUserInfoByEmail($email)
{
$param = Yohobuy::param();
$param['method'] = 'app.passport.userlist';
$param['email'] = $email;
$param['debug'] = 'Y';
$param['screen_size'] = '320x568';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param, 3600);
}
}