refactor(service): 优化多个服务中的订单处理逻辑
This commit is contained in:
parent
ab3e0f2416
commit
bde35c7360
@ -290,6 +290,7 @@ class Core
|
|||||||
$project_id = false;
|
$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);
|
$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) {
|
if (!$order) {
|
||||||
|
@ -95,7 +95,9 @@ class MerchantService extends Service
|
|||||||
$new_cash = $percent*$cash;
|
$new_cash = $percent*$cash;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Log::write('test', 'test', $new_cash);
|
|
||||||
|
|
||||||
|
// Log::write('test', 'test', $new_cash);
|
||||||
# 得到产品分成
|
# 得到产品分成
|
||||||
if ($pid) {
|
if ($pid) {
|
||||||
$product = ProductService::instance()->get($mid, $pid);
|
$product = ProductService::instance()->get($mid, $pid);
|
||||||
@ -128,6 +130,8 @@ class MerchantService extends Service
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return array($cash, $new_cash, $product_cash, $profit);
|
return array($cash, $new_cash, $product_cash, $profit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,6 +140,7 @@ class MerchantService extends Service
|
|||||||
{
|
{
|
||||||
$info = $this->getInfo($mid);
|
$info = $this->getInfo($mid);
|
||||||
|
|
||||||
|
|
||||||
if ($info) {
|
if ($info) {
|
||||||
list($cash, $new_cash, $product_cash, $profit) = $this->cash($info['percent'], $cash, $mid, $pid, $product_key, $project_id, $account, $isp);
|
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['appid'], false);
|
||||||
//$this->get($info['id'], false);
|
//$this->get($info['id'], false);
|
||||||
|
|
||||||
|
|
||||||
return array($new_cash, $product_cash, $account_type);
|
return array($new_cash, $product_cash, $account_type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,6 +107,7 @@ class OrderService extends Service
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!$info) {
|
if (!$info) {
|
||||||
$data['error_account_oper'] = 1;
|
$data['error_account_oper'] = 1;
|
||||||
$data['id'] = $this->db()->insertGetId($data);
|
$data['id'] = $this->db()->insertGetId($data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user