CommentData.php 1.36 KB
<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016-3-23
 * Time: 15:03
 */

namespace LibModels\Web\Home;

use Api\Yohobuy;
use Api\Sign;

class CommentData
{
    //获取评论列表
    public static function getCommentListData($uid)
    {
        $param = array();
        $param = Yohobuy::param();
        $param['method'] = 'web.show.queryOrderProductCommentList';
        $param['uid'] = $uid;
        $param['client_secret'] = Sign::getSign($param);

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


    //评论商品
    public static function saveShareOrder($uid, $productSkn, $productId, $content, $goodsId, $orderId, $erpSkuId)
    {
        //组装parameters参数数组
        $parameters = array(
            //'anonymous' => false,
            'content' => $content,
            'goodsId' => $goodsId,
            'orderId' => $orderId,
            'productId' => $productId,
            'productSkn' => $productSkn,
            'uid' => $uid,
            'erpSkuId' => $erpSkuId
        );

        $param = array();
        $param = Yohobuy::param();
        $param['method'] = 'show.saveShareOrder';
        $param['parameters'] = json_encode($parameters);
        $param['client_secret'] = Sign::getSign($param);

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

}