OrderData.php 3.73 KB
<?php

namespace LibModels\Wap\Home;

use Api\Yohobuy;
use Api\Sign;

/**
 * Description of OrderData
 *
 * @author Administrator
 */
class OrderData
{
    /*
     * 获取订单数据
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */

    public static function getOrderData($type, $page, $limit, $gender, $yh_channel, $uid)
    {
        //构建必传参数
        $param = Yohobuy::param();
        $param['gender'] = $gender;
        $param['limit'] = $limit;
        $param['method'] = 'app.SpaceOrders.get';
        $param['page'] = $page;
        $param['type'] = $type;
        $param['uid'] = $uid;
        $param['yh_channel'] = $yh_channel;
        $param['client_secret'] = Sign::getSign($param);
        //调用接口获得数据
        return Yohobuy::get(Yohobuy::API_URL, $param);
    }

    /*
     * 取消订单
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */

    public static function cancelOrderData($order_code, $uid, $gender, $yh_channel)
    {
        //构建必传参数
        $param = Yohobuy::param();
        $param['order_code'] = $order_code;
        $param['uid'] = $uid;
        $param['gender'] = $gender;
        $param['yh_channel'] = $yh_channel;
        $param['method'] = 'app.SpaceOrders.close';
        $param['client_secret'] = Sign::getSign($param);
        //调用接口获得数据
        return Yohobuy::get(Yohobuy::API_URL, $param);
    }

    /*
     * 删除订单
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */

    public static function deleteOrderData($order_code, $uid, $gender, $yh_channel)
    {
        //构建必传参数
        $param = Yohobuy::param();
        $param['order_code'] = $order_code;
        $param['uid'] = $uid;
        $param['gender'] = $gender;
        $param['yh_channel'] = $yh_channel;
        $param['method'] = 'app.SpaceOrders.delOrderByCode';
        $param['client_secret'] = Sign::getSign($param);
        //调用接口删除订单
        return Yohobuy::get(Yohobuy::API_URL, $param);
    }

    /*
     * 我的订单-查看物流
     * 
     * @param int $orderCode 订单号
     * @param int $uid 用户ID
     * @return array
     */
    public static function LogisticsData($orderCode, $uid)
    {
        //构建必传参数
        $param = Yohobuy::param();
        $param['method'] = 'app.express.li';
        $param['order_code'] = $orderCode;
        $param['uid'] = $uid;
        $param['client_secret'] = Sign::getSign($param);
        //调用接口获得数据
        return Yohobuy::get(Yohobuy::API_URL, $param);
    }

    /*
     * 支付url
     * To change this template file, choose Tools | Templates
     */
    public static function paymentData($gender, $yh_channel, $code)
    {
        //构建必传参数
        $param = Yohobuy::param();
        $param['content_code'] = $code;
        $param['gender'] = $gender;
        $param['yh_channel'] = $yh_channel;
        $param['client_secret'] = Sign::getSign($param);
        //调用接口获得数据
        return Yohobuy::get(Yohobuy::SERVICE_URL . '/operations/api/v5/resource/get', $param);
    }

    /*
     * 随便逛逛url
     * 
     * 备注:暂不使用
     */
    public static function strollData($gender, $yh_channel, $code)
    {
        //构建必传参数
        $param = Yohobuy::param();
        $param['content_code'] = $code;
        $param['gender'] = $gender;
        $param['yh_channel'] = $yh_channel;
        $param['client_secret'] = Sign::getSign($param);
        //调用接口获得数据
        return Yohobuy::get(Yohobuy::SERVICE_URL . '/operations/api/v5/resource/get', $param);
    }

}