From bde35c7360d132fc7f285c9c65bce473a7fbd63f Mon Sep 17 00:00:00 2001 From: mzeros Date: Sat, 7 Dec 2024 14:18:39 +0800 Subject: [PATCH] =?UTF-8?q?refactor(service):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA=E6=9C=8D=E5=8A=A1=E4=B8=AD=E7=9A=84=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/channel/service/system/Core.php | 1 + app/merchant/service/MerchantService.php | 8 +++++++- app/merchant/service/OrderService.php | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/channel/service/system/Core.php b/app/channel/service/system/Core.php index 8726032..1aca763 100644 --- a/app/channel/service/system/Core.php +++ b/app/channel/service/system/Core.php @@ -290,6 +290,7 @@ class Core $project_id = false; } + $order = OrderService::instance()->up($this->data['merchant'], $channel['id'], $product['id'], $product['key'], $order_id, $channel_order_id, $merchant_order_id, $cash, $url, $request, $response_data, $status, $account, $parent_order_id, $project_id, $card_id, $this->data['param'], $kou); if (!$order) { diff --git a/app/merchant/service/MerchantService.php b/app/merchant/service/MerchantService.php index fec33fd..654b1ef 100644 --- a/app/merchant/service/MerchantService.php +++ b/app/merchant/service/MerchantService.php @@ -95,7 +95,9 @@ class MerchantService extends Service $new_cash = $percent*$cash; } } - Log::write('test', 'test', $new_cash); + + +// Log::write('test', 'test', $new_cash); # 得到产品分成 if ($pid) { $product = ProductService::instance()->get($mid, $pid); @@ -128,6 +130,8 @@ class MerchantService extends Service } } + + return array($cash, $new_cash, $product_cash, $profit); } @@ -135,6 +139,7 @@ class MerchantService extends Service public function setFrozenAccount($oid, $order_id, $mid, $pid, $product_key, $cash, $project_id = false, $account = '', $isp = -1, $time = false, $fushu = false) { $info = $this->getInfo($mid); + if ($info) { list($cash, $new_cash, $product_cash, $profit) = $this->cash($info['percent'], $cash, $mid, $pid, $product_key, $project_id, $account, $isp); @@ -163,6 +168,7 @@ class MerchantService extends Service //$this->get($info['appid'], false); //$this->get($info['id'], false); + return array($new_cash, $product_cash, $account_type); } } diff --git a/app/merchant/service/OrderService.php b/app/merchant/service/OrderService.php index 1db9cf2..421fa8e 100644 --- a/app/merchant/service/OrderService.php +++ b/app/merchant/service/OrderService.php @@ -106,7 +106,8 @@ class OrderService extends Service } } } - + + if (!$info) { $data['error_account_oper'] = 1; $data['id'] = $this->db()->insertGetId($data);