|
|
@@ -570,15 +570,21 @@ class HdRefundMallClass
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 顾客端售后列表(mallApp 退款售后页,跨店)
|
|
|
+ * 顾客端售后列表(mallApp 退款售后页,跨店;可按订单收窄)
|
|
|
* @param int $userId 当前登录商城用户
|
|
|
* @param string $tab all|pending|0|refunded|1|closed|2|3
|
|
|
+ * @param int $orderId 可选,>0 时只返回该订单的顾客申请(订单详情「申请记录」)
|
|
|
* @return array 分页 list + pendingCount
|
|
|
*/
|
|
|
- public static function getCustomApplyList($userId, $tab = 'all')
|
|
|
+ public static function getCustomApplyList($userId, $tab = 'all', $orderId = 0)
|
|
|
{
|
|
|
$userId = (int)$userId;
|
|
|
+ $orderId = (int)$orderId;
|
|
|
$where = ['userId' => $userId];
|
|
|
+ // 订单详情进入时只看本单,避免混入其它订单售后
|
|
|
+ if ($orderId > 0) {
|
|
|
+ $where['orderId'] = $orderId;
|
|
|
+ }
|
|
|
$tab = (string)$tab;
|
|
|
if ($tab === 'pending' || $tab === '0') {
|
|
|
$where['status'] = HdRefundClass::STATUS_PENDING;
|
|
|
@@ -591,10 +597,14 @@ class HdRefundMallClass
|
|
|
}
|
|
|
|
|
|
$data = HdRefundClass::getList('*', $where, 'addTime DESC');
|
|
|
- $data['pendingCount'] = (int)HdRefundClass::getCount([
|
|
|
+ $pendingWhere = [
|
|
|
'userId' => $userId,
|
|
|
'status' => HdRefundClass::STATUS_PENDING,
|
|
|
- ]);
|
|
|
+ ];
|
|
|
+ if ($orderId > 0) {
|
|
|
+ $pendingWhere['orderId'] = $orderId;
|
|
|
+ }
|
|
|
+ $data['pendingCount'] = (int)HdRefundClass::getCount($pendingWhere);
|
|
|
if (!empty($data['list'])) {
|
|
|
$data['list'] = self::formatCustomList($data['list']);
|
|
|
} else {
|