...
|
...
|
@@ -34,14 +34,14 @@ class ReturnsModel |
|
|
if (isset($returnsData['code']) && $returnsData['code'] == 200 && !empty($returnsData['data']['list'])) {
|
|
|
//设置分页
|
|
|
$pager = self::setPager($returnsData['data']['page'], $returnsData['data']['total'], $returnsData['data']['total_page'], $limit);
|
|
|
foreach($returnsData['data']['list'] as $key => $value){
|
|
|
foreach ($returnsData['data']['list'] as $key => $value) {
|
|
|
$list[$key]['orderNum'] = $value['order_code'];
|
|
|
$list[$key]['orderTime'] = str_replace('-','/',$value['order_create_time']);
|
|
|
$list[$key]['orderTime'] = str_replace('-', '/', $value['order_create_time']);
|
|
|
$list[$key]['returnTime'] = $value['create_time'];
|
|
|
if ($value['refund_type'] == 1) {
|
|
|
$list[$key]['isChange'] = false;
|
|
|
$uri = '/home/returns/refundDetail';
|
|
|
}elseif ($value['refund_type'] == 2) {
|
|
|
} elseif ($value['refund_type'] == 2) {
|
|
|
$list[$key]['isChange'] = true;
|
|
|
$uri = '/home/returns/exchangeDetail';
|
|
|
}
|
...
|
...
|
@@ -49,10 +49,10 @@ class ReturnsModel |
|
|
$param = array(
|
|
|
'id' => $value['id']
|
|
|
);
|
|
|
$list[$key]['moreHref'] = helpers::url($uri,$param);
|
|
|
$list[$key]['moreHref'] = helpers::url($uri, $param);
|
|
|
$list[$key]['goods'] = self::getGoodsData($value['goods']);
|
|
|
}
|
|
|
}else{
|
|
|
} else {
|
|
|
$list = array(
|
|
|
'empty' => '您没有退/换货订单'
|
|
|
);
|
...
|
...
|
@@ -62,8 +62,8 @@ class ReturnsModel |
|
|
$path = UserModel::getCenterCrumb('退货/换货');
|
|
|
$leftNav = UserModel::getCenterLeftNav('我的退/换货', $uid);
|
|
|
$data = array(
|
|
|
'path'=>$path,
|
|
|
'homeNav'=>$leftNav,
|
|
|
'path' => $path,
|
|
|
'homeNav' => $leftNav,
|
|
|
'orders' => $list,
|
|
|
'userThumb' => UserModel::getUserHeadImg($uid),
|
|
|
'pager' => $pager
|
...
|
...
|
@@ -97,13 +97,13 @@ class ReturnsModel |
|
|
$detail['express']['number'] = isset($res['notice']['express_number']) ? $res['notice']['express_number'] : '';
|
|
|
$detail['express']['id'] = isset($res['notice']['express_id']) ? $res['notice']['express_id'] : '';
|
|
|
}
|
|
|
foreach($res['statusList'] as $key=>$value){
|
|
|
$detail['statusList'][$key]['act'] = ($value['act' ] == 'Y') ? true : false;
|
|
|
foreach ($res['statusList'] as $key => $value) {
|
|
|
$detail['statusList'][$key]['act'] = ($value['act'] == 'Y') ? true : false;
|
|
|
$detail['statusList'][$key]['name'] = $value['name'];
|
|
|
}
|
|
|
$detail['goods'] = self::getDetailGoods($res['goods_list']);
|
|
|
$detail['expressList'] = self::getExpressCompany();
|
|
|
}else{
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -111,10 +111,10 @@ class ReturnsModel |
|
|
$path = UserModel::getCenterCrumb('退货/换货');
|
|
|
$leftNav = UserModel::getCenterLeftNav('我的退/换货', $uid);
|
|
|
$data = array(
|
|
|
'path'=>$path,
|
|
|
'homeNav'=>$leftNav,
|
|
|
'path' => $path,
|
|
|
'homeNav' => $leftNav,
|
|
|
'userThumb' => UserModel::getUserHeadImg($uid),
|
|
|
'detail'=>$detail
|
|
|
'detail' => $detail
|
|
|
);
|
|
|
|
|
|
return $data;
|
...
|
...
|
@@ -145,7 +145,7 @@ class ReturnsModel |
|
|
$detail['express']['company'] = isset($res['notice']['express_company']) ? $res['notice']['express_company'] : '';
|
|
|
$detail['express']['number'] = isset($res['notice']['express_number']) ? $res['notice']['express_number'] : '';
|
|
|
}
|
|
|
foreach($res['statusList'] as $key=>$value){
|
|
|
foreach ($res['statusList'] as $key => $value) {
|
|
|
$detail['statusList'][$key]['act'] = ($value['act'] == 'Y') ? true : false;
|
|
|
$detail['statusList'][$key]['name'] = $value['name'];
|
|
|
}
|
...
|
...
|
@@ -153,17 +153,17 @@ class ReturnsModel |
|
|
$detail['backMode'] = isset($res['return_amount_mode_name']) ? $res['return_amount_mode_name'] : '';
|
|
|
$detail['goods'] = self::getDetailGoods($res['goods_list']);
|
|
|
$detail['expressList'] = self::getExpressCompany();
|
|
|
}else{
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
//面包屑-左侧导航
|
|
|
$path = UserModel::getCenterCrumb('退货/换货');
|
|
|
$leftNav = UserModel::getCenterLeftNav('我的退/换货', $uid);
|
|
|
$data = array(
|
|
|
'path'=>$path,
|
|
|
'homeNav'=>$leftNav,
|
|
|
'path' => $path,
|
|
|
'homeNav' => $leftNav,
|
|
|
'userThumb' => UserModel::getUserHeadImg($uid),
|
|
|
'detail'=>$detail
|
|
|
'detail' => $detail
|
|
|
);
|
|
|
|
|
|
return $data;
|
...
|
...
|
@@ -184,7 +184,7 @@ class ReturnsModel |
|
|
$cnAlphabet = $value['cn_alphabet'];
|
|
|
}
|
|
|
$result[$key]['href'] = Helpers::getUrlBySkc($value['product_id'], $value['goods_id'], $cnAlphabet);
|
|
|
$result[$key]['thumb'] = Helpers::getImageUrl($value['goods_image'],60,60);
|
|
|
$result[$key]['thumb'] = Helpers::getImageUrl($value['goods_image'], 60, 60);
|
|
|
$result[$key]['name'] = $value['product_name'];
|
|
|
$result[$key]['color'] = $value['color_name'];
|
|
|
$result[$key]['size'] = $value['size_name'];
|
...
|
...
|
@@ -241,7 +241,7 @@ class ReturnsModel |
|
|
$expressList = ReturnsData::getExpressCompany();
|
|
|
if (isset($expressList['code']) && $expressList['code'] == 200) {
|
|
|
$result = array_values($expressList['data']);
|
|
|
foreach($result as $key=>$value){
|
|
|
foreach ($result as $key => $value) {
|
|
|
$res = array_merge_recursive($res, $value);
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -260,9 +260,9 @@ class ReturnsModel |
|
|
* @param $isChange
|
|
|
* @return mixed
|
|
|
*/
|
|
|
public static function setExpressNumber($id, $expressId, $expressNumber,$uid, $expressCompany, $isChange)
|
|
|
public static function setExpressNumber($id, $expressId, $expressNumber, $uid, $expressCompany, $isChange)
|
|
|
{
|
|
|
$data = ReturnsData::setExpressNumber($id, $expressId, $expressNumber,$uid, $expressCompany, $isChange);
|
|
|
$data = ReturnsData::setExpressNumber($id, $expressId, $expressNumber, $uid, $expressCompany, $isChange);
|
|
|
return $data;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -282,13 +282,13 @@ class ReturnsModel |
|
|
//调用接口成功,封装数据
|
|
|
if (isset($data['code']) && $data['code'] == 200 && isset($data['data']['goods_list']) && !empty($data['data']['goods_list'])) {
|
|
|
$amount = '';
|
|
|
foreach($data['data']['goods_list'] as $key=>$value){
|
|
|
foreach ($data['data']['goods_list'] as $key => $value) {
|
|
|
$cnAlphabet = '';
|
|
|
if (!empty($value['cn_alphabet'])) {
|
|
|
$cnAlphabet = $value['cn_alphabet'];
|
|
|
}
|
|
|
$result['goods'][$key]['href'] = Helpers::getUrlBySkc($value['product_id'], $value['goods_id'], $cnAlphabet);
|
|
|
$result['goods'][$key]['thumb'] = Helpers::getImageUrl($value['goods_image'],60,60);
|
|
|
$result['goods'][$key]['thumb'] = Helpers::getImageUrl($value['goods_image'], 60, 60);
|
|
|
$result['goods'][$key]['name'] = $value['product_name'];
|
|
|
$result['goods'][$key]['color'] = $value['color_name'];
|
|
|
$result['goods'][$key]['size'] = $value['size_name'];
|
...
|
...
|
@@ -311,7 +311,7 @@ class ReturnsModel |
|
|
$result['yohoCoin'] = $data['data']['yoho_coin_num'];
|
|
|
$result['coupon'] = $data['data']['coupon_amount'];
|
|
|
$result['cash'] = $amount;
|
|
|
foreach($data['data']['return_amount_mode'] as &$value){
|
|
|
foreach ($data['data']['return_amount_mode'] as &$value) {
|
|
|
if ($value['is_default'] == 'Y') {
|
|
|
$value['default'] = true;
|
|
|
}
|
...
|
...
|
@@ -324,8 +324,8 @@ class ReturnsModel |
|
|
$leftNav = UserModel::getCenterLeftNav('我的退/换货', $uid);
|
|
|
$pager = array();
|
|
|
$data = array(
|
|
|
'path'=>$path,
|
|
|
'homeNav'=>$leftNav,
|
|
|
'path' => $path,
|
|
|
'homeNav' => $leftNav,
|
|
|
'refund' => $result,
|
|
|
'pager' => $pager
|
|
|
);
|
...
|
...
|
@@ -349,13 +349,13 @@ class ReturnsModel |
|
|
$productSkn = array();
|
|
|
//数据获取成功,封装数据
|
|
|
if (isset($data['code']) && $data['code'] == 200 && isset($data['data']) && !empty($data['data'])) {
|
|
|
foreach ($data['data']['goods_list'] as $key=>$value) {
|
|
|
foreach ($data['data']['goods_list'] as $key => $value) {
|
|
|
$cnAlphabet = '';
|
|
|
if (!empty($value['cn_alphabet'])) {
|
|
|
$cnAlphabet = $value['cn_alphabet'];
|
|
|
}
|
|
|
$result['goods'][$key]['href'] = Helpers::getUrlBySkc($value['product_id'], $value['goods_id'], $cnAlphabet);
|
|
|
$result['goods'][$key]['thumb'] = Helpers::getImageUrl($value['goods_image'],60,60);
|
|
|
$result['goods'][$key]['thumb'] = Helpers::getImageUrl($value['goods_image'], 60, 60);
|
|
|
$result['goods'][$key]['name'] = $value['product_name'];
|
|
|
$result['goods'][$key]['color'] = $value['color_name'];
|
|
|
$result['goods'][$key]['size'] = $value['size_name'];
|
...
|
...
|
@@ -377,6 +377,16 @@ class ReturnsModel |
|
|
$productSkn[] += $value['product_skn'];
|
|
|
}
|
|
|
$result['reason'] = $data['data']['exchange_reason'];
|
|
|
|
|
|
// tar note 对数组做处理,为不显示的添加 inactive
|
|
|
if (isset($data['data']['special_exchange_reason'])) {
|
|
|
foreach ($result['reason'] as $key => $item) {
|
|
|
if (!in_array($item, $data['data']['special_exchange_reason'])) {
|
|
|
$result['reason'][$key]['inactive'] = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$result['orderCode'] = $orderCode;
|
|
|
|
|
|
//换货地址相关数据(邮编为可空参数)
|
...
|
...
|
@@ -399,8 +409,8 @@ class ReturnsModel |
|
|
|
|
|
foreach ($product as $key => $value) {//遍历得到每件商品
|
|
|
$num = '0';//初始化每件商品的库存为0
|
|
|
foreach ($value['goods_list'] as $k=>$v) {//遍历商品得到每个颜色
|
|
|
foreach ($v['size_list'] as $k1=>$v1) {//遍历颜色得到每个尺码
|
|
|
foreach ($value['goods_list'] as $k => $v) {//遍历商品得到每个颜色
|
|
|
foreach ($v['size_list'] as $k1 => $v1) {//遍历颜色得到每个尺码
|
|
|
$num += $v1['storage_number'];//将商品颜色对应尺码下的每个商品的库存相加
|
|
|
if ($v1['storage_number'] > 0) {//当某个尺码下有库存时,将该颜色及其对应的尺码加入该商品选项下
|
|
|
$result['goods'][$key]['colorSize'][$k]['color'] = $v['color_name'];
|
...
|
...
|
@@ -418,14 +428,14 @@ class ReturnsModel |
|
|
$result['goods'][$key]['banMsg'] = '库存不足不能换货';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
//面包屑-左侧导航
|
|
|
$path = UserModel::getCenterCrumb('退货/换货');
|
|
|
$leftNav = UserModel::getCenterLeftNav('我的退/换货', $uid);
|
|
|
$pager = array();
|
|
|
$data = array(
|
|
|
'path'=>$path,
|
|
|
'homeNav'=>$leftNav,
|
|
|
'path' => $path,
|
|
|
'homeNav' => $leftNav,
|
|
|
'exchange' => $result,
|
|
|
'pager' => $pager
|
|
|
);
|
...
|
...
|
@@ -441,7 +451,7 @@ class ReturnsModel |
|
|
*/
|
|
|
public static function getSizeList($sizeList)
|
|
|
{
|
|
|
foreach ($sizeList as $key=>$value) {
|
|
|
foreach ($sizeList as $key => $value) {
|
|
|
if ($value['storage_number'] <= 0) {
|
|
|
unset($sizeList[$key]);
|
|
|
}
|
...
|
...
|
@@ -504,7 +514,7 @@ class ReturnsModel |
|
|
//调取接口查询订单详情
|
|
|
$order = OrderData::viewOrderData($orderCode, $uid, '');
|
|
|
if (empty($order)) {
|
|
|
return array('code'=>403,'message'=>'没有找到该订单');
|
|
|
return array('code' => 403, 'message' => '没有找到该订单');
|
|
|
}
|
|
|
// //订单7天后不能退款
|
|
|
// if (isset($order['code']) && $order['code'] == 200) {
|
...
|
...
|
@@ -544,7 +554,7 @@ class ReturnsModel |
|
|
//调取接口查询订单详情
|
|
|
$order = OrderData::viewOrderData($orderCode, $uid, '');
|
|
|
if (empty($order)) {
|
|
|
return array('code'=>403,'message'=>'没有找到该订单');
|
|
|
return array('code' => 403, 'message' => '没有找到该订单');
|
|
|
}
|
|
|
// //订单15天后不能换货
|
|
|
// if (isset($order['code']) && $order['code'] == 200) {
|
...
|
...
|
@@ -579,8 +589,8 @@ class ReturnsModel |
|
|
$path = UserModel::getCenterCrumb('退货/换货');
|
|
|
$leftNav = UserModel::getCenterLeftNav('我的退/换货', $uid);
|
|
|
$data = array(
|
|
|
'path'=>$path,
|
|
|
'homeNav'=>$leftNav,
|
|
|
'path' => $path,
|
|
|
'homeNav' => $leftNav,
|
|
|
'save' => array(
|
|
|
'type' => '退货',
|
|
|
'ordersHref' => Helpers::url('/home/orders'),
|
...
|
...
|
@@ -609,8 +619,8 @@ class ReturnsModel |
|
|
$path = UserModel::getCenterCrumb('退货/换货');
|
|
|
$leftNav = UserModel::getCenterLeftNav('我的退/换货', $uid);
|
|
|
$data = array(
|
|
|
'path'=>$path,
|
|
|
'homeNav'=>$leftNav,
|
|
|
'path' => $path,
|
|
|
'homeNav' => $leftNav,
|
|
|
'save' => array(
|
|
|
'type' => '换货',
|
|
|
'ordersHref' => Helpers::url('/home/orders'),
|
...
|
...
|
|