CurrencyData.php 1.06 KB
<?php

namespace LibModels\Web\Home;

use Api\Yohobuy;
use Api\Sign;

class CurrencyData
{
    /**
     * YOHO币列表数据
     *
     * @param int $uid 用户ID
     * @param array $condition 条件
     * @return array YOHO币接口返回的数据
     */
    public static function yohoCoinList($uid, $condition = array())
    {
        $param = Yohobuy::param();
        $param['method'] = 'app.yohocoin.lists';
        $param['uid'] = $uid;
        $param['page'] = 1;
        $param['limit'] = 15;
        $param = array_merge($param, $condition);
        $param['client_secret'] = Sign::getSign($param);
        return Yohobuy::get(Yohobuy::API_URL, $param);
    }

    /**
     * yoho币总数
     * @param $uid
     * @return array
     */
    public static function yohoCoinTotal($uid)
    {
        $param = Yohobuy::param();
        $param['method'] = 'app.yoho.yohocoin';
        $param['uid'] = $uid;
        $param['client_secret'] = Sign::getSign($param);
        return Yohobuy::get(Yohobuy::API_URL, $param);
    }

}