OrderData.php 2.15 KB
<?php

namespace LibModels\Wap\Home;

use Api\Yohobuy;
use Api\Sign;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

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

    public 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_URL2, $param);
    }

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

    public function cancelOrderData($order_code, $uid, $gender, $yh_channel, $method) {
        $param = Yohobuy::param();
        $param['order_code'] = $order_code;
        $param['uid'] = $uid;
        $param['gender'] = $gender;
        $param['yh_channel'] = $yh_channel;
        $param['method'] = $method;
        $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 function deleteOrderData($order_code, $uid, $gender, $yh_channel, $method) {
        $param = Yohobuy::param();
        $param['order_code'] = $order_code;
        $param['uid'] = $uid;
        $param['gender'] = $gender;
        $param['yh_channel'] = $yh_channel;
        $param['method'] = $method;
        $param['client_secret'] = Sign::getSign($param);

        return Yohobuy::get(Yohobuy::API_URL, $param);
    }

}