GradeData.php 1.78 KB
<?php

namespace LibModels\Wap\Home;

use Api\Yohobuy;
use Api\Sign;

/*
 * 个人中心-会员等级接口操作类
 */

class GradeData
{

    /**
     * 获取会员等级数据
     * @param  string  $yh_channel   频道数据,1->男,2->女,3->潮童,4->创意生活,5->其他
     * @param  string  $uid          用户id
     * @return array                 接口返回的会员等级数据
     */
    public function getGradeData($channel, $uid) {

        $param = Yohobuy::param();
        $param['yh_channel'] = $channel;
        $param['uid'] = $uid;
        $param['method'] = 'app.Passport.vip';
        $param['client_secret'] = Sign::getSign($param);
        return Yohobuy::get(Yohobuy::API_URL, $param);
    }

    /**
     * 获取会员特权详情数据
     * @param  string  $yh_channel   频道数据,1->男,2->女,3->潮童,4->创意生活,5->其他
     * @param  string  $uid          用户id
     * @return array                 接口返回的会员特权详情数据
     */
    public function getPreferentialData($channel, $uid) {

        $param = Yohobuy::param();
        $param['yh_channel'] = $channel;
        $param['uid'] = $uid;
        $param['method'] = 'app.passport.getPrivilege';
        $param['client_secret'] = Sign::getSign($param);
        return Yohobuy::get(Yohobuy::API_URL, $param);
    }

    /**
     * 获取用户基本信息数据
     */
    public function getUserProfileData($gender, $uid, $channel) {
        $param = Yohobuy::param();
        $param['gender'] = $gender;
        $param['uid'] = $uid;
        $param['yh_channel'] = $channel;
        $param['method'] = 'app.passport.profile';
        $param['client_secret'] = Sign::getSign($param);
        
        return Yohobuy::get("http://api.open.yohobuy.com/",$param);
    }

}