refactor(service): 优化多个服务中的订单处理逻辑

This commit is contained in:
mzeros 2024-12-07 14:18:39 +08:00
parent ab3e0f2416
commit bde35c7360
3 changed files with 10 additions and 2 deletions

View File

@ -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) {

View File

@ -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);
}
@ -136,6 +140,7 @@ class MerchantService extends Service
{
$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);
}
}

View File

@ -107,6 +107,7 @@ class OrderService extends Service
}
}
if (!$info) {
$data['error_account_oper'] = 1;
$data['id'] = $this->db()->insertGetId($data);