|
|
@@ -1,8 +1,8 @@
|
|
|
<?php
|
|
|
/**
|
|
|
* 售后资金/隔天售后辅助服务
|
|
|
- * 用途:资格校验、资金快照(fundType/onlinePay/payWay)、隔天通过后的金额与返余额。
|
|
|
- * 字段:sameDay 区分当天/隔天;fundType 当天隔天通用;onlinePay/payWay 落在售后单上。
|
|
|
+ * 用途:资格校验、支付快照与资金三态(hasReturn/couldReturn/returnBalance)、隔天金额与返余额。
|
|
|
+ * 字段:sameDay 区分当天/隔天;onlinePay/payWay 与原单一致;废弃 fundType。
|
|
|
*/
|
|
|
namespace bizGhs\order\services;
|
|
|
|
|
|
@@ -25,16 +25,10 @@ class NextDayRefundService
|
|
|
const SAME_DAY_YES = 1;
|
|
|
const SAME_DAY_NO = 0;
|
|
|
|
|
|
- /** 资金未确认 */
|
|
|
- const FUND_UNUSED = 0;
|
|
|
- /** 原路退回 */
|
|
|
- const FUND_ORIGINAL = 1;
|
|
|
- /** 返充到余额 */
|
|
|
- const FUND_BALANCE = 2;
|
|
|
- /** 线下自行转账(原「仅记账」) */
|
|
|
- const FUND_NONE = 3;
|
|
|
- /** 与 FUND_NONE 同义,便于语义阅读 */
|
|
|
- const FUND_OFFLINE = 3;
|
|
|
+ /** 三态开关:否 */
|
|
|
+ const FLAG_NO = 0;
|
|
|
+ /** 三态开关:是 */
|
|
|
+ const FLAG_YES = 1;
|
|
|
|
|
|
/**
|
|
|
* 是否有有效支付时间(售后唯一时间依据;无支付时间不能售后)
|
|
|
@@ -102,7 +96,6 @@ class NextDayRefundService
|
|
|
'ok' => true,
|
|
|
'reason' => '',
|
|
|
'sameDay' => self::SAME_DAY_NO,
|
|
|
- 'suggestFundBalance' => true,
|
|
|
'orderCleared' => $orderCleared ? 1 : 0,
|
|
|
'hasPayTime' => 1,
|
|
|
];
|
|
|
@@ -123,15 +116,15 @@ class NextDayRefundService
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 原单是否为微信/支付宝线上支付(隔天也可原路退回的前提)
|
|
|
+ * 是否微信/支付宝线上支付(看订单或售后快照)
|
|
|
*/
|
|
|
- public static function isOnlinePayOrder($order)
|
|
|
+ public static function isOnlinePayOrder($orderOrRefund)
|
|
|
{
|
|
|
- if (empty($order)) {
|
|
|
+ if (empty($orderOrRefund)) {
|
|
|
return false;
|
|
|
}
|
|
|
- $payWay = intval($order->payWay ?? 0);
|
|
|
- $onlinePay = intval($order->onlinePay ?? dict::getDict('onlinePay', 'not'));
|
|
|
+ $payWay = intval($orderOrRefund->payWay ?? 0);
|
|
|
+ $onlinePay = intval($orderOrRefund->onlinePay ?? dict::getDict('onlinePay', 'not'));
|
|
|
$wxPay = dict::getDict('payWay', 'wxPay');
|
|
|
$aliPay = dict::getDict('payWay', 'alipay');
|
|
|
return $onlinePay == dict::getDict('onlinePay', 'yes')
|
|
|
@@ -139,136 +132,59 @@ class NextDayRefundService
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 隔天售后未选手选资金时的默认值:线上默认原路,其它默认返余额。
|
|
|
+ * 余额付或挂账:原路就是动余额/欠款,禁止再「返充」
|
|
|
*/
|
|
|
- public static function defaultNextDayFundType($order)
|
|
|
+ public static function isBalanceOrDebtPayWay($payWay)
|
|
|
{
|
|
|
- return self::isOnlinePayOrder($order) ? self::FUND_ORIGINAL : self::FUND_BALANCE;
|
|
|
+ $payWay = intval($payWay);
|
|
|
+ return $payWay === intval(dict::getDict('payWay', 'balancePay'))
|
|
|
+ || $payWay === intval(dict::getDict('payWay', 'debtPay'));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 当天售后未选手选资金时的默认值:线上原路;余额/挂账返余额;线下默认线下转账。
|
|
|
- */
|
|
|
- public static function defaultSameDayFundType($order)
|
|
|
- {
|
|
|
- if (self::isOnlinePayOrder($order)) {
|
|
|
- return self::FUND_ORIGINAL;
|
|
|
- }
|
|
|
- $payWay = intval($order->payWay ?? 0);
|
|
|
- $balancePay = dict::getDict('payWay', 'balancePay');
|
|
|
- $debtPay = dict::getDict('payWay', 'debtPay');
|
|
|
- if ($payWay === $balancePay || $payWay === $debtPay) {
|
|
|
- return self::FUND_BALANCE;
|
|
|
- }
|
|
|
- return self::FUND_NONE;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 解析资金方式(当天/隔天通用):挂账/余额强制返余额;线上可选原路/返余额/线下转账。
|
|
|
- * $hasRelateOrder=false 表示无原单退款,不可原路退。
|
|
|
- */
|
|
|
- public static function resolveFundType($fundType, $order, $hasRelateOrder = true)
|
|
|
- {
|
|
|
- $fundType = intval($fundType);
|
|
|
- // 无原单:只能返余额或线下自行转账
|
|
|
- if (!$hasRelateOrder || empty($order)) {
|
|
|
- if ($fundType === self::FUND_ORIGINAL) {
|
|
|
- util::fail('无原单退款不能原路退回');
|
|
|
- }
|
|
|
- if (!in_array($fundType, [self::FUND_BALANCE, self::FUND_NONE], true)) {
|
|
|
- return self::FUND_BALANCE;
|
|
|
- }
|
|
|
- return $fundType;
|
|
|
- }
|
|
|
- $payWay = intval($order->payWay ?? 0);
|
|
|
- $debtPay = dict::getDict('payWay', 'debtPay');
|
|
|
- $balancePay = dict::getDict('payWay', 'balancePay');
|
|
|
- // 挂账/余额付款:资金落到返充余额
|
|
|
- if ($payWay === $debtPay || $payWay === $balancePay) {
|
|
|
- return self::FUND_BALANCE;
|
|
|
- }
|
|
|
- // 线上付款:可选原路 / 返余额 / 线下转账
|
|
|
- if (self::isOnlinePayOrder($order)) {
|
|
|
- if (!in_array($fundType, [self::FUND_ORIGINAL, self::FUND_BALANCE, self::FUND_NONE], true)) {
|
|
|
- util::fail('请选择资金处理方式');
|
|
|
- }
|
|
|
- return $fundType;
|
|
|
- }
|
|
|
- // 线下付款:返余额或线下自行转账
|
|
|
- if (!in_array($fundType, [self::FUND_BALANCE, self::FUND_NONE], true)) {
|
|
|
- return self::FUND_BALANCE;
|
|
|
- }
|
|
|
- return $fundType;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 生成写入售后单的资金快照:fundType + onlinePay + payWay(落 xhRefund/xhCgRefund)。
|
|
|
- * onlinePay:原路且走线上通道为 2,否则 1;payWay:原路/线下转账的具体渠道。
|
|
|
+ * 生成售后资金快照(落 xhRefund/xhCgRefund)
|
|
|
+ * - 有原单:onlinePay/payWay 与订单一致;余额/挂账 couldReturn=0,其它=1
|
|
|
+ * - 无原单:线下渠道由选手选 payWay;couldReturn=1(成功页可改走余额)
|
|
|
*
|
|
|
- * @param int $fundTypeInput 前端/上游传入,0 表示按 sameDay 自动默认
|
|
|
* @param object|null $order 原销售单;无原单传 null
|
|
|
* @param bool $hasRelateOrder 是否有关联原单
|
|
|
- * @param array $options sameDay、payWay(线下转账选手选渠道)
|
|
|
- * @return array{fundType:int,onlinePay:int,payWay:int}
|
|
|
+ * @param array $options payWay(无原单线下渠道)
|
|
|
+ * @return array{onlinePay:int,payWay:int,hasReturn:int,couldReturn:int,returnBalance:int}
|
|
|
*/
|
|
|
- public static function buildRefundFundSnapshot($fundTypeInput, $order = null, $hasRelateOrder = true, $options = [])
|
|
|
+ public static function buildRefundPaySnapshot($order = null, $hasRelateOrder = true, $options = [])
|
|
|
{
|
|
|
- $fundTypeInput = intval($fundTypeInput);
|
|
|
- $sameDay = intval($options['sameDay'] ?? self::SAME_DAY_YES);
|
|
|
$onlineNot = intval(dict::getDict('onlinePay', 'not'));
|
|
|
- $onlineYes = intval(dict::getDict('onlinePay', 'yes'));
|
|
|
-
|
|
|
- if ($fundTypeInput === self::FUND_UNUSED && $hasRelateOrder && !empty($order)) {
|
|
|
- $fundTypeInput = ($sameDay === self::SAME_DAY_NO)
|
|
|
- ? self::defaultNextDayFundType($order)
|
|
|
- : self::defaultSameDayFundType($order);
|
|
|
- }
|
|
|
-
|
|
|
- $fundType = self::resolveFundType($fundTypeInput, $order, $hasRelateOrder);
|
|
|
-
|
|
|
- // 返充余额:渠道固定为余额,非线上原路
|
|
|
- if ($fundType === self::FUND_BALANCE) {
|
|
|
- return [
|
|
|
- 'fundType' => self::FUND_BALANCE,
|
|
|
- 'onlinePay' => $onlineNot,
|
|
|
- 'payWay' => intval(dict::getDict('payWay', 'balancePay')),
|
|
|
- ];
|
|
|
- }
|
|
|
-
|
|
|
- // 线下自行转账:优先用选手选 payWay(微信/支付宝/现金/银行卡)
|
|
|
- if ($fundType === self::FUND_NONE) {
|
|
|
- $payWay = self::normalizeOfflinePayWay($options['payWay'] ?? null, $order);
|
|
|
+ // 兼容旧调用名:内部仍可被 buildRefundFundSnapshot 转发
|
|
|
+ if (!$hasRelateOrder || empty($order)) {
|
|
|
+ $payWay = self::normalizeOfflinePayWay($options['payWay'] ?? null, null);
|
|
|
return [
|
|
|
- 'fundType' => self::FUND_NONE,
|
|
|
'onlinePay' => $onlineNot,
|
|
|
'payWay' => $payWay,
|
|
|
+ 'hasReturn' => self::FLAG_NO,
|
|
|
+ 'couldReturn' => self::FLAG_YES,
|
|
|
+ 'returnBalance' => self::FLAG_NO,
|
|
|
];
|
|
|
}
|
|
|
-
|
|
|
- // 原路退回:线上微信/支付宝标记 onlinePay=2;否则记线下原路渠道
|
|
|
- if ($fundType === self::FUND_ORIGINAL && !empty($order)) {
|
|
|
- $orderPayWay = intval($order->payWay ?? 0);
|
|
|
- if (self::isOnlinePayOrder($order)) {
|
|
|
- return [
|
|
|
- 'fundType' => self::FUND_ORIGINAL,
|
|
|
- 'onlinePay' => $onlineYes,
|
|
|
- 'payWay' => $orderPayWay,
|
|
|
- ];
|
|
|
- }
|
|
|
- return [
|
|
|
- 'fundType' => self::FUND_ORIGINAL,
|
|
|
- 'onlinePay' => $onlineNot,
|
|
|
- 'payWay' => $orderPayWay,
|
|
|
- ];
|
|
|
- }
|
|
|
-
|
|
|
+ $payWay = intval($order->payWay ?? 0);
|
|
|
+ $onlinePay = intval($order->onlinePay ?? $onlineNot);
|
|
|
+ $couldReturn = self::isBalanceOrDebtPayWay($payWay) ? self::FLAG_NO : self::FLAG_YES;
|
|
|
return [
|
|
|
- 'fundType' => self::FUND_UNUSED,
|
|
|
- 'onlinePay' => $onlineNot,
|
|
|
- 'payWay' => 0,
|
|
|
+ 'onlinePay' => $onlinePay,
|
|
|
+ 'payWay' => $payWay,
|
|
|
+ 'hasReturn' => self::FLAG_NO,
|
|
|
+ 'couldReturn' => $couldReturn,
|
|
|
+ 'returnBalance' => self::FLAG_NO,
|
|
|
];
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @deprecated 已废弃 fundType;保留转发以免旧调用报错
|
|
|
+ */
|
|
|
+ public static function buildRefundFundSnapshot($fundTypeInput, $order = null, $hasRelateOrder = true, $options = [])
|
|
|
+ {
|
|
|
+ return self::buildRefundPaySnapshot($order, $hasRelateOrder, $options);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 线下转账渠道:允许 0微信/1支付宝/4现金/5银行卡;非法则回落原单或现金
|
|
|
*/
|
|
|
@@ -293,8 +209,93 @@ class NextDayRefundService
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * GHS 侧隔天通过:累计 nextDayTkPrice,按 fundType 处理资金,不改 actPrice。
|
|
|
- * @return string 返余额后的客户余额(非返余额则为当前余额)
|
|
|
+ * 售后单与采购镜像同步资金三态
|
|
|
+ */
|
|
|
+ public static function syncRefundFundFlags($refund, $fields = [])
|
|
|
+ {
|
|
|
+ if (empty($refund) || empty($fields)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ foreach ($fields as $k => $v) {
|
|
|
+ $refund->$k = $v;
|
|
|
+ }
|
|
|
+ $refund->save(false, array_keys($fields));
|
|
|
+ $cgRefundId = intval($refund->cgRefundId ?? 0);
|
|
|
+ if ($cgRefundId <= 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $cgRefund = CgRefundClass::getById($cgRefundId, true);
|
|
|
+ if (empty($cgRefund)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ foreach ($fields as $k => $v) {
|
|
|
+ $cgRefund->$k = $v;
|
|
|
+ }
|
|
|
+ $cgRefund->save(false, array_keys($fields));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 标记已原路退回(现金/银行卡等线下人工确认)
|
|
|
+ */
|
|
|
+ public static function markHasReturn($refund)
|
|
|
+ {
|
|
|
+ if (empty($refund)) {
|
|
|
+ util::fail('退款单不存在');
|
|
|
+ }
|
|
|
+ if (intval($refund->status) !== RefundOrderClass::STATUS_COMPLETE) {
|
|
|
+ util::fail('售后未通过,不能确认原路退回');
|
|
|
+ }
|
|
|
+ if (intval($refund->returnBalance ?? 0) === self::FLAG_YES) {
|
|
|
+ util::fail('已返充余额,不能再标记原路退回');
|
|
|
+ }
|
|
|
+ if (intval($refund->hasReturn ?? 0) === self::FLAG_YES) {
|
|
|
+ return $refund;
|
|
|
+ }
|
|
|
+ self::syncRefundFundFlags($refund, ['hasReturn' => self::FLAG_YES]);
|
|
|
+ return RefundOrderClass::getById($refund->id, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 不想线下原路时:返充到客户余额(须 couldReturn=1 且尚未原路)
|
|
|
+ * @return array{refund:object,customBalance:string}
|
|
|
+ */
|
|
|
+ public static function applyReturnBalance($refund, $order = null)
|
|
|
+ {
|
|
|
+ if (empty($refund)) {
|
|
|
+ util::fail('退款单不存在');
|
|
|
+ }
|
|
|
+ if (intval($refund->status) !== RefundOrderClass::STATUS_COMPLETE) {
|
|
|
+ util::fail('售后未通过,不能返充余额');
|
|
|
+ }
|
|
|
+ if (intval($refund->hasReturn ?? 0) === self::FLAG_YES) {
|
|
|
+ util::fail('已原路退回,不能再返充余额');
|
|
|
+ }
|
|
|
+ if (intval($refund->returnBalance ?? 0) === self::FLAG_YES) {
|
|
|
+ util::fail('已返充到余额');
|
|
|
+ }
|
|
|
+ if (intval($refund->couldReturn ?? 0) !== self::FLAG_YES) {
|
|
|
+ util::fail('该单不允许返充到余额');
|
|
|
+ }
|
|
|
+
|
|
|
+ $customId = intval($refund->customId ?? 0);
|
|
|
+ $custom = CustomClass::getLockById($customId);
|
|
|
+ if (empty($custom)) {
|
|
|
+ util::fail('没有找到客户');
|
|
|
+ }
|
|
|
+ $pair = GhsRechargeSettleService::lockAccountPair($custom);
|
|
|
+ CustomClass::nextDayRefundReturnBalance($pair['custom'], $pair['ghs'], $refund, $order);
|
|
|
+ self::syncRefundFundFlags($refund, ['returnBalance' => self::FLAG_YES]);
|
|
|
+
|
|
|
+ $custom = CustomClass::getById($customId, true);
|
|
|
+ return [
|
|
|
+ 'refund' => RefundOrderClass::getById($refund->id, true),
|
|
|
+ 'customBalance' => bcadd((string)($custom->balance ?? '0'), '0', 2),
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * GHS 侧隔天通过:累计 nextDayTkPrice;余额/挂账原路加余额并 hasReturn=1;线上/线下现金等留给通道或人工。
|
|
|
+ * @return string 当前客户余额
|
|
|
*/
|
|
|
public static function applyGhsAmountAndFund($refund, $order)
|
|
|
{
|
|
|
@@ -315,20 +316,22 @@ class NextDayRefundService
|
|
|
$custom->buyAmount = $buyAmount;
|
|
|
$custom->save(false, ['buyAmount']);
|
|
|
|
|
|
- $fundType = intval($refund->fundType ?? self::FUND_UNUSED);
|
|
|
+ $payWay = intval($refund->payWay ?? ($order->payWay ?? 0));
|
|
|
$balance = bcadd((string)($custom->balance ?? '0'), '0', 2);
|
|
|
- if ($fundType === self::FUND_BALANCE) {
|
|
|
+ // 余额/挂账:原路=加回余额,完成后 hasReturn=1(couldReturn 已为 0)
|
|
|
+ if (self::isBalanceOrDebtPayWay($payWay)) {
|
|
|
$pair = GhsRechargeSettleService::lockAccountPair($custom);
|
|
|
CustomClass::nextDayRefundReturnBalance($pair['custom'], $pair['ghs'], $refund, $order);
|
|
|
+ self::syncRefundFundFlags($refund, ['hasReturn' => self::FLAG_YES]);
|
|
|
$custom = CustomClass::getById($customId, true);
|
|
|
$balance = bcadd((string)($custom->balance ?? '0'), '0', 2);
|
|
|
}
|
|
|
- // FUND_ORIGINAL:网关退款在采购侧执行;FUND_NONE:线下自行转账(只记账)
|
|
|
+ // 线上原路在采购侧发起;现金/银行卡等线下原路等人工 markHasReturn
|
|
|
return $balance;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * HD 采购侧隔天通过:累计 nextDayTkPrice;原路退走拉卡拉,不改 actPrice。
|
|
|
+ * HD 采购侧隔天通过:累计 nextDayTkPrice;线上原路走拉卡拉成功后 hasReturn=1。
|
|
|
*/
|
|
|
public static function applyCgAmountAndFund($cgRefund, $cg)
|
|
|
{
|
|
|
@@ -337,9 +340,17 @@ class NextDayRefundService
|
|
|
$cg->refund = PurchaseClass::REFUND_YES;
|
|
|
$cg->save(false, ['nextDayTkPrice', 'refund']);
|
|
|
|
|
|
- $fundType = intval($cgRefund->fundType ?? self::FUND_UNUSED);
|
|
|
- if ($fundType === self::FUND_ORIGINAL) {
|
|
|
+ if (self::isOnlinePayOrder($cgRefund) || self::isOnlinePayOrder($cg)) {
|
|
|
CgRefundClass::nextDayOriginalOnlineRefund($cgRefund, $cg);
|
|
|
+ $cgRefund->hasReturn = self::FLAG_YES;
|
|
|
+ $cgRefund->save(false, ['hasReturn']);
|
|
|
+ $saleRefundId = intval($cgRefund->saleRefundId ?? 0);
|
|
|
+ if ($saleRefundId > 0) {
|
|
|
+ $saleRefund = RefundOrderClass::getById($saleRefundId, true);
|
|
|
+ if (!empty($saleRefund)) {
|
|
|
+ self::syncRefundFundFlags($saleRefund, ['hasReturn' => self::FLAG_YES]);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$ghsId = intval($cg->ghsId ?? 0);
|
|
|
@@ -357,7 +368,7 @@ class NextDayRefundService
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 无原单退款通过:加库存(退货退款)、累计门店支出、扣客户消费、按 fundType 返余额/仅记账。
|
|
|
+ * 无原单退款通过:加库存(退货退款)、累计门店支出、扣客户消费;资金留给成功页确认原路/返充。
|
|
|
* 不写订单 nextDayTkPrice(无关联销售单)。
|
|
|
*/
|
|
|
public static function passFreeRefund($refund)
|
|
|
@@ -448,8 +459,8 @@ class NextDayRefundService
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 无原单退款资金:扣减客户累计消费;返余额走成对账户,仅记账不动余额。
|
|
|
- * @return string 处理后的客户余额
|
|
|
+ * 无原单退款资金:仅扣减客户累计消费;原路/返充在成功页由 markHasReturn / applyReturnBalance 落地。
|
|
|
+ * @return string 当前客户余额
|
|
|
*/
|
|
|
public static function applyFreeFund($refund)
|
|
|
{
|
|
|
@@ -466,16 +477,7 @@ class NextDayRefundService
|
|
|
$custom->buyAmount = $buyAmount;
|
|
|
$custom->save(false, ['buyAmount']);
|
|
|
|
|
|
- $fundType = intval($refund->fundType ?? self::FUND_UNUSED);
|
|
|
- $balance = bcadd((string)($custom->balance ?? '0'), '0', 2);
|
|
|
- if ($fundType === self::FUND_BALANCE) {
|
|
|
- $pair = GhsRechargeSettleService::lockAccountPair($custom);
|
|
|
- // 无原单:order 传 null,流水挂售后单号
|
|
|
- CustomClass::nextDayRefundReturnBalance($pair['custom'], $pair['ghs'], $refund, null);
|
|
|
- $custom = CustomClass::getById($customId, true);
|
|
|
- $balance = bcadd((string)($custom->balance ?? '0'), '0', 2);
|
|
|
- }
|
|
|
- return $balance;
|
|
|
+ return bcadd((string)($custom->balance ?? '0'), '0', 2);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -501,8 +503,9 @@ class NextDayRefundService
|
|
|
*/
|
|
|
public static function listForChannelIncomeDeduct($mainId, $startTime, $endTime)
|
|
|
{
|
|
|
- $sql = "SELECT r.refundPrice AS amount, r.fundType, o.id AS orderId,
|
|
|
- o.debtPrice, o.remainDebtPrice, o.onlinePay, o.payWay AS orderPayWay, o.payWay
|
|
|
+ $sql = "SELECT r.refundPrice AS amount, r.hasReturn, r.returnBalance, r.couldReturn,
|
|
|
+ r.onlinePay AS refundOnlinePay, r.payWay AS refundPayWay,
|
|
|
+ o.id AS orderId, o.debtPrice, o.remainDebtPrice, o.onlinePay, o.payWay AS orderPayWay, o.payWay
|
|
|
FROM xhRefund r
|
|
|
LEFT JOIN xhGhsOrder o ON o.orderSn = r.relateOrderSn
|
|
|
WHERE r.mainId=:mainId AND r.status=:status AND r.sameDay=:sameDay
|