Authored by liangxs

Merge branch 'feature/rebuy' of http://git.yoho.cn/fe/YOHOBUYWAP into feature/rebuy

... ... @@ -163,4 +163,20 @@ class OrderData
return Yohobuy::post(Yohobuy::API_URL, $param);
}
/**
* 再次购买
* @param type $uid
* @param type $orderCode
* @return type
*/
public static function reAddData($uid, $orderCode)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.readd';
$param['uid'] = $uid;
$param['orderCode'] = $orderCode;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -10,6 +10,7 @@ use Plugin\Pay\weixin\JsApiPay;
use Plugin\Pay\weixin\lib\WxPayUnifiedOrder;
use Plugin\Pay\weixin\lib\WxPayApi;
use Plugin\Pay\weixin\lib\WxPayConfig;
use LibModels\Wap\Home\OrderData;
/**
* 个人中心相关的控制器
... ... @@ -803,6 +804,35 @@ class HomeController extends AbstractAction
//渲染模板
$this->_view->display('order-content', $order);
}
/**
* 我的订单——再次购买
*/
public function reAddAction()
{
$result = array('code' => 400, 'message' => '', 'data' => '');
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax()) {
break;
}
//获取相关参数
$uid = $this->getUid(true);
$orderCode = $this->get('orderCode', '');
if (!$uid || !$orderCode) {
$result = array('code' => 400, 'message' => '缺失必填项', 'data' => '');
break;
}
$result = OrderData::reAddData($uid, $orderCode);
if (!isset($result['code'])) {
break;
}
}
while (false);
$this->echoJson($result);
}
/*
* 我的订单-取消订单
... ...