|
|
<?php
|
|
|
|
|
|
namespace LibModels\Wap\Home;
|
|
|
|
|
|
use Api\Sign;
|
|
|
use Api\Yohobuy;
|
|
|
|
|
|
/**
|
|
|
* 个人中心的数据模型
|
|
|
*
|
|
|
* @name UserData
|
|
|
* @package LibModels/Wap/Home
|
|
|
* @copyright yoho.inc
|
|
|
* @version 1.0 (2015-11-09 16:30:27)
|
|
|
* @author Gtskk <tttt6399998@126.com>
|
|
|
*/
|
|
|
class UserData
|
|
|
{
|
|
|
|
|
|
/**
|
|
|
* 个人详情数据
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @return array 个人详情接口返回的数据
|
|
|
*/
|
|
|
public static function userData($uid)
|
|
|
{
|
|
|
$param = Yohobuy::param();
|
|
|
$param['method'] = 'app.passport.profile';
|
|
|
$param['uid'] = $uid;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
return Yohobuy::get(Yohobuy::API_URL, $param);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 订单数据
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @param int $type 订单类型,1表示全部,2表示待付款,3表示待发货,4表示待收货,5表示待评价
|
|
|
* @param int $page 第几页,默认1
|
|
|
* @param int $limit 限制读取的数目,默认10
|
|
|
* @return array 订单接口返回的数据
|
|
|
*/
|
|
|
public static function orderData($uid, $type, $page = 1, $limit = 10)
|
|
|
{
|
|
|
$param = Yohobuy::param();
|
|
|
$param['method'] = 'app.SpaceOrders.get';
|
|
|
$param['uid'] = $uid;
|
|
|
$param['type'] = $type;
|
|
|
$param['page'] = $page;
|
|
|
$param['limit'] = $limit;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
return Yohobuy::get(Yohobuy::API_URL, $param);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 收藏的商品数据
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @param int $page 第几页,默认1
|
|
|
* @param int $limit 限制读取的数目,默认10
|
|
|
* @return array 收藏的商品接口返回的数据
|
|
|
*/
|
|
|
public static function favoriteProductData($uid, $page = 1, $limit = 10)
|
|
|
{
|
|
|
$param = Yohobuy::param();
|
|
|
$param['method'] = 'app.favorite.product';
|
|
|
$param['uid'] = $uid;
|
|
|
$param['page'] = $page;
|
|
|
$param['limit'] = $limit;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
return Yohobuy::get(Yohobuy::API_URL, $param);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 收藏的品牌数据
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @param string $gender 性别 1,3表示男,2,3表示女,1,2,3表示全部
|
|
|
* @param int $page 第几页,默认1
|
|
|
* @param int $limit 限制读取的数目,默认10
|
|
|
* @return array 收藏的品牌接口返回的数据
|
|
|
*/
|
|
|
public static function favoriteBrandData($uid, $gender, $page = 1, $limit = 10)
|
|
|
{
|
|
|
$param = Yohobuy::param();
|
|
|
$param['method'] = 'app.favorite.brand';
|
|
|
$param['uid'] = $uid;
|
|
|
$param['gender'] = $gender;
|
|
|
$param['page'] = $page;
|
|
|
$param['limit'] = $limit;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
return Yohobuy::get(Yohobuy::API_URL, $param);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* YOHO币数据
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @param int $page 第几页,默认1
|
|
|
* @param int $limit 限制读取的数目,默认10
|
|
|
* @return array YOHO币接口返回的数据
|
|
|
*/
|
|
|
public static function yohoCoinData($uid, $page = 1, $limit = 10)
|
|
|
{
|
|
|
$param = Yohobuy::param();
|
|
|
$param['method'] = 'app.yohocoin.lists';
|
|
|
$param['uid'] = $uid;
|
|
|
$param['page'] = $page;
|
|
|
$param['limit'] = $limit;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
return Yohobuy::get(Yohobuy::API_URL, $param);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 优惠券数据
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @param int $status 优惠券状态,0表示未使用,1表示已使用
|
|
|
* @param int $page 第几页,默认1
|
|
|
* @param int $limit 限制读取的数目,默认10
|
|
|
* @return array 优惠券接口返回的数据
|
|
|
*/
|
|
|
public static function couponData($uid, $status, $page = 1, $limit = 10)
|
|
|
{
|
|
|
$param = Yohobuy::param();
|
|
|
$param['method'] = 'app.yohocoin.lists';
|
|
|
$param['uid'] = $uid;
|
|
|
$param['status'] = $status;
|
|
|
$param['page'] = $page;
|
|
|
$param['limit'] = $limit;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
return Yohobuy::get(Yohobuy::API_URL, $param);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 地址数据
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @return array 地址接口返回的数据
|
|
|
*/
|
|
|
public static function addressData($uid)
|
|
|
{
|
|
|
$param = Yohobuy::param();
|
|
|
$param['method'] = 'app.address.get';
|
|
|
$param['uid'] = $uid;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
return Yohobuy::get(Yohobuy::API_URL, $param);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 意见反馈数据
|
|
|
*
|
|
|
* @param string $udid 客户端唯一标识
|
|
|
* @param int $page 第几页,默认1
|
|
|
* @param int $limit 限制读取的数目,默认10
|
|
|
* @return array 意见反馈接口返回的数据
|
|
|
*/
|
|
|
public static function suggestData($udid, $page = 1, $limit = 30)
|
|
|
{
|
|
|
$param = Yohobuy::param();
|
|
|
$param['udid'] = $udid;
|
|
|
$param['page'] = $page;
|
|
|
$param['limit'] = $limit;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
return Yohobuy::get(Yohobuy::SERVICE_URL . 'suggest/api/v1/suggest/getList', $param);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 提交意见反馈接口
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @param string $content 意见内容
|
|
|
* @param int $suggest_type 意见类型
|
|
|
* @return array 意见反馈接口返回的数据
|
|
|
*/
|
|
|
public static function savesuggestData($uid, $content, $suggest_type, $limit = 30)
|
|
|
{
|
|
|
$param = Yohobuy::param();
|
|
|
$param['uid'] = $uid;
|
|
|
$param['content'] = $content;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
return Yohobuy::get(Yohobuy::SERVICE_URL . 'suggest/api/v1/suggest/saveSuggest', $param);
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|