Commit 24a856ac authored by wanjilong's avatar wanjilong

add: 支持商品结算价处理

parent 28b26114
...@@ -351,11 +351,18 @@ class PayService ...@@ -351,11 +351,18 @@ class PayService
continue; continue;
} }
//处理商家结算价格的兼容
if($row['clear_payment'] > 0 && $row['pay_sub_type'] == 102) {
$pay_amount = $row['clear_payment'];
} else {
$pay_amount = $row['pay_amount'];
}
$wallet_list[] = [ $wallet_list[] = [
'user_id' => $row['account_id'], 'user_id' => $row['account_id'],
'service_name' => 10, 'service_name' => 10,
'source_name' => 1, 'source_name' => 1,
'amount' => $row['pay_amount'], 'amount' => $pay_amount,
'third_order_id' => $row['pay_order_clearing_item_id'], 'third_order_id' => $row['pay_order_clearing_item_id'],
'third_order_id_type' => $row['pay_sub_type'], 'third_order_id_type' => $row['pay_sub_type'],
'third_order_desc' => $row['remark'], 'third_order_desc' => $row['remark'],
...@@ -650,16 +657,24 @@ class PayService ...@@ -650,16 +657,24 @@ class PayService
$current_tip = Strategy::getTip($r['payment'], $total_amount, $cleared_amount, $total_tip, $cleared_tip); $current_tip = Strategy::getTip($r['payment'], $total_amount, $cleared_amount, $total_tip, $cleared_tip);
$id = $this->gen_pay_order_clearing_item_id(); $id = $this->gen_pay_order_clearing_item_id();
//商家资金需要显示商品名称 //商家资金需要显示商品名称
if($account['pay_sub_type'] == 102) { if($account['pay_sub_type'] == 102) {
$remark = $r['goods_name'] ?? ''; $remark = $r['goods_name'] ?? '';
if(mb_strlen($remark) > 100) { if(mb_strlen($remark) > 100) {
$remark = mb_substr($remark, 0, 100) . '...'; $remark = mb_substr($remark, 0, 100) . '...';
} }
if(!empty($r['clear_price'])) {
$clear_payment = $r['goods_num'] * $r['clear_price'];
} else {
$clear_payment = 0;
}
} else { } else {
$remark = ''; $remark = '';
$clear_payment = 0;
} }
$this->clear_items_list[] = [ $this->clear_items_list[] = [
'pay_order_clearing_item_id' => $id, 'pay_order_clearing_item_id' => $id,
'pay_order_clearing_id' => $pay_order_clearing_id, 'pay_order_clearing_id' => $pay_order_clearing_id,
...@@ -669,6 +684,7 @@ class PayService ...@@ -669,6 +684,7 @@ class PayService
'account_id' => $account['account_id'], 'account_id' => $account['account_id'],
'account_type' => $account['account_type'], 'account_type' => $account['account_type'],
'pay_amount' => $current_tip, 'pay_amount' => $current_tip,
'clear_payment' => $clear_payment, //商品结算价格
'pay_type' => $account['pay_type'], 'pay_type' => $account['pay_type'],
'pay_sub_type' => $account['pay_sub_type'], 'pay_sub_type' => $account['pay_sub_type'],
'remark' => $remark, 'remark' => $remark,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment