Commit 5cba5d0c authored by wanjilong's avatar wanjilong

add: pay_v2 to pay

parent 0d759b99
......@@ -6,5 +6,5 @@ use Api\PhpUtils\Mysql\MysqlBase;
class CallbackLog extends MysqlBase
{
const TABLE_NAME = 'callback_log';
const CONFIG_INDEX = 'pay_v2';
const CONFIG_INDEX = 'pay';
}
......@@ -7,7 +7,7 @@ use App\Exception\custom\PayException;
class PayOrder extends MysqlBase
{
const TABLE_NAME = 'pay_order';
const CONFIG_INDEX = 'pay_v2';
const CONFIG_INDEX = 'pay';
/**
* @param $order_id
......
......@@ -6,5 +6,5 @@ use Api\PhpUtils\Mysql\MysqlBase;
class PayOrderClearing extends MysqlBase
{
const TABLE_NAME = 'pay_order_clearing';
const CONFIG_INDEX = 'pay_v2';
const CONFIG_INDEX = 'pay';
}
......@@ -7,7 +7,7 @@ use App\Exception\BaseException;
class PayOrderClearingItem extends MysqlBase
{
const TABLE_NAME = 'pay_order_clearing_item';
const CONFIG_INDEX = 'pay_v2';
const CONFIG_INDEX = 'pay';
public static function marketSaleCount($accountId) {
......
......@@ -6,5 +6,5 @@ use Api\PhpUtils\Mysql\MysqlBase;
class PayOrderItem extends MysqlBase
{
const TABLE_NAME = 'pay_order_item';
const CONFIG_INDEX = 'pay_v2';
const CONFIG_INDEX = 'pay';
}
......@@ -6,5 +6,5 @@ use Api\PhpUtils\Mysql\MysqlBase;
class RefundOrder extends MysqlBase
{
const TABLE_NAME = 'refund_order';
const CONFIG_INDEX = 'pay_v2';
const CONFIG_INDEX = 'pay';
}
......@@ -1014,26 +1014,26 @@ class PayService
//商家资金需要显示商品名称
$remark = $r['goods_name'] ?? '';
if(mb_strlen($remark) > 100) {
if (mb_strlen($remark) > 100) {
$remark = mb_substr($remark, 0, 100) . '...';
}
if(!empty($r['clear_price'])) {
if (!empty($r['clear_price'])) {
$clear_payment = $r['goods_num'] * $r['clear_price'];
$platform_amount = $current_tip - $clear_payment;
if(!empty($r['clear_price'])) {
if (!empty($r['clear_price'])) {
$clear_payment = $r['goods_num'] * $r['clear_price'];
} else {
$clear_payment = $current_tip;
$platform_amount = 0;
}
if($platform_amount < 0) {
throw new PayException(['cus'=>12]); //结算价不能大于商家分成部分
if ($platform_amount < 0) {
throw new PayException(['cus' => 12]); //结算价不能大于商家分成部分
}
if($platform_amount > 0) {
if ($platform_amount > 0) {
//结算价剩余部分返回平台
$platform['amount'] += $platform_amount;
$this->clear_items_list[] = [
......@@ -1051,7 +1051,8 @@ class PayService
'remark' => '',
];
} else{}
} else {
}
$this->clear_items_list[] = [
'pay_order_clearing_item_id' => array_shift($this->gen_ids),
......@@ -1087,7 +1088,7 @@ class PayService
];
//结算价格收益返回平台
if($platform['amount'] > 0) {
if ($platform['amount'] > 0) {
$this->clear_list[] = [
'pay_order_clearing_id' => $p_clearing_id,
'pay_order_id' => $this->pay_order['pay_order_id'],
......@@ -1099,7 +1100,7 @@ class PayService
'pay_sub_type' => $platform['pay_sub_type'],
];
}
}
return $merchant_cash;
}
......
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