ComplaintsData.php 2.09 KB
<?php

namespace LibModels\Web\Home;

use Api\Yohobuy;
use Api\Sign;

class ComplaintsData
{

    /**
     * 获取投诉列表
     * @param type $uid
     * @param type $page
     * @param type $limit
     * @return type
     */
    public static function getComplaintsList($uid, $page = 1, $limit = 10,$clientType = 'web')
    {
        $param = Yohobuy::param();
        $param['method'] = 'web.complaints.getList';
        $param['uid'] = $uid;
        $param['page'] = $page;
        $param['limit'] = $limit;
        $param['client_type'] = $clientType;
        $param['private_key'] = Yohobuy::$privateKeyList[$clientType];
        $param['client_secret'] = Sign::getSign($param);
        return Yohobuy::get(Yohobuy::API_URL, $param);
    }

    /**
     * 添加投诉
     * @param type $params
     * @return type
     */
    public static function addComplaints($params,$clientType = 'web')
    {
        $param = Yohobuy::param();
        $param['method'] = 'web.complaints.add';
        $param['uid'] = $params['uid'];
        $param['title'] = $params['title'];
        $param['customer'] = $params['customer'];
        $param['complaintsType'] = $params['complaintsType'];
        $param['orderCode'] = $params['orderCode'];
        $param['content'] = $params['content'];
        $param['client_type'] = $clientType;
        $param['private_key'] = Yohobuy::$privateKeyList[$clientType];
        $param['client_secret'] = Sign::getSign($param);
        return Yohobuy::get(Yohobuy::API_URL, $param);
    }

    /**
     * 取消投诉
     * @param type $uid
     * @param type $id
     */
    public static function cancelComplaints($uid, $id, $clientType = 'web')
    {
        $param = Yohobuy::param();
        $param['method'] = 'web.complaints.cancel';
        $param['uid'] = $uid;
        $param['id'] = $id;
        $param['client_type'] = $clientType;
        $param['private_key'] = Yohobuy::$privateKeyList[$clientType];
        $param['client_secret'] = Sign::getSign($param);
        return Yohobuy::get(Yohobuy::API_URL, $param);
    }

}