...
|
...
|
@@ -2,6 +2,7 @@ |
|
|
use Action\WebAction;
|
|
|
use Home\ReturnsModel;
|
|
|
use WebPlugin\Helpers;
|
|
|
use LibModels\Web\Home\ReturnsData;
|
|
|
|
|
|
class ReturnsController extends WebAction
|
|
|
{
|
...
|
...
|
@@ -53,7 +54,7 @@ class ReturnsController extends WebAction |
|
|
{
|
|
|
/* 判断是不是AJAX请求 */
|
|
|
if (!$this->isAjax()) {
|
|
|
return;
|
|
|
return;
|
|
|
}
|
|
|
$areaCode = $this->post('areaCode');
|
|
|
//获取必要参数
|
...
|
...
|
@@ -82,14 +83,14 @@ class ReturnsController extends WebAction |
|
|
$uid = $this->getUid();
|
|
|
$goods = $this->post('goods');
|
|
|
$payment = $this->post('payment');
|
|
|
if (empty($orderCode) || $orderCode<1 || empty($goods) || empty($payment)) {
|
|
|
$this->echoJson(array('code'=>203,'message'=>'非法提交'));
|
|
|
if (empty($orderCode) || $orderCode < 1 || empty($goods) || empty($payment)) {
|
|
|
$this->echoJson(array('code' => 203, 'message' => '非法提交'));
|
|
|
}
|
|
|
//调用模型提交退货申请
|
|
|
$res = ReturnsModel::saveRefund($orderCode, $uid, $goods, $payment);
|
|
|
//退货申请成功,返回前端相应格式,并返回退货成功页跳转地址
|
|
|
if (isset($res['code']) && $res['code'] == 200) {
|
|
|
$successUrl = Helpers::url('/home/returns/refundSuccess', array('orderCode'=>$orderCode));
|
|
|
$successUrl = Helpers::url('/home/returns/refundSuccess', array('orderCode' => $orderCode));
|
|
|
$res['data']['refer'] = $successUrl;
|
|
|
}
|
|
|
$this->echoJson($res);
|
...
|
...
|
@@ -117,8 +118,8 @@ class ReturnsController extends WebAction |
|
|
$deliveryType = $this->post('deliveryType');
|
|
|
|
|
|
//判断参数合法性
|
|
|
if (empty($orderCode) || $orderCode<1 || empty($goods) || empty($deliveryType) || empty($consigneeName) || empty($areaCode) || empty($address) || empty($mobile)) {
|
|
|
$this->echoJson(array('code'=>203,'message'=>'非法提交'));
|
|
|
if (empty($orderCode) || $orderCode < 1 || empty($goods) || empty($deliveryType) || empty($consigneeName) || empty($areaCode) || empty($address) || empty($mobile)) {
|
|
|
$this->echoJson(array('code' => 203, 'message' => '非法提交'));
|
|
|
return;
|
|
|
}
|
|
|
//调用模型提交换货申请
|
...
|
...
|
@@ -126,7 +127,7 @@ class ReturnsController extends WebAction |
|
|
|
|
|
//换货成功,返回前端相应格式,并返回换货成功页跳转链接
|
|
|
if (isset($res['code']) && $res['code'] == '200') {
|
|
|
$successUrl = Helpers::url('/home/returns/exchangeSuccess', array('orderCode'=>$orderCode));
|
|
|
$successUrl = Helpers::url('/home/returns/exchangeSuccess', array('orderCode' => $orderCode));
|
|
|
$res['data']['refer'] = $successUrl;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -204,6 +205,7 @@ class ReturnsController extends WebAction |
|
|
//头部导航
|
|
|
$channel = Helpers::getChannelNameByCookie();
|
|
|
$this->setWebNavHeader($channel);
|
|
|
|
|
|
$this->_view->display('returns-detail', array('meReturnsPage' => true, 'returns' => $data));
|
|
|
}
|
|
|
|
...
|
...
|
@@ -224,6 +226,7 @@ class ReturnsController extends WebAction |
|
|
//头部导航
|
|
|
$channel = Helpers::getChannelNameByCookie();
|
|
|
$this->setWebNavHeader($channel);
|
|
|
|
|
|
$this->_view->display('returns-detail', array('meReturnsPage' => true, 'returns' => $data));
|
|
|
}
|
|
|
|
...
|
...
|
@@ -246,11 +249,11 @@ class ReturnsController extends WebAction |
|
|
$expressNumber = $this->post('expressNumber');
|
|
|
$uid = $this->getUid();
|
|
|
$expressCompany = $this->post('expressCompany');
|
|
|
$res = array('code'=>201,'message'=>'请求失败');
|
|
|
$res = array('code' => 201, 'message' => '请求失败');
|
|
|
if (!isset($id) || !isset($expressId) || !isset($expressNumber) || !isset($uid) || !isset($expressCompany) || !isset($isChange)) {
|
|
|
return $res;
|
|
|
}
|
|
|
$res = ReturnsModel::setExpressNumber($id, $expressId, $expressNumber,$uid, $expressCompany, $isChange);
|
|
|
$res = ReturnsModel::setExpressNumber($id, $expressId, $expressNumber, $uid, $expressCompany, $isChange);
|
|
|
|
|
|
$this->echoJson($res);
|
|
|
}
|
...
|
...
|
@@ -263,7 +266,7 @@ class ReturnsController extends WebAction |
|
|
{
|
|
|
//判断是否登录,未登录则退出
|
|
|
if (!$this->getUid()) {
|
|
|
$this->echoJson(array('code'=>'400','message'=>'请登录'));
|
|
|
$this->echoJson(array('code' => '400', 'message' => '请登录'));
|
|
|
exit;
|
|
|
}
|
|
|
$result = ReturnsModel::saveRefundImg('fileData');
|
...
|
...
|
@@ -271,7 +274,43 @@ class ReturnsController extends WebAction |
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 取消退货申请
|
|
|
*/
|
|
|
public function cancelRefundAction()
|
|
|
{
|
|
|
$orderId = $this->get('id');
|
|
|
$uid = $this->getUid();
|
|
|
if (!$this->isAjax()) {
|
|
|
return;
|
|
|
}
|
|
|
$res = ReturnsData::cancelRefund($orderId, $uid);
|
|
|
$result = array();
|
|
|
if ($res['code'] === 200) {
|
|
|
$result['message'] = $res['message'];
|
|
|
}
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 取消换货申请
|
|
|
*/
|
|
|
public function cancelChangeAction()
|
|
|
{
|
|
|
$orderId = $this->get('id');
|
|
|
$uid = $this->getUid();
|
|
|
if (!$this->isAjax()) {
|
|
|
return;
|
|
|
}
|
|
|
$res = ReturnsData::cancelChange($orderId, $uid);
|
|
|
$result = array();
|
|
|
if ($res['code'] === 200) {
|
|
|
$result['message'] = $res['message'];
|
|
|
}
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 个人中心-根据商品skn,颜色,尺码返回商品的sku,goodsId(待用)
|
...
|
...
|
|