Commit 5cba5d0c authored by wanjilong's avatar wanjilong

add: pay_v2 to pay

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