refactor(service): 优化多个服务中的订单处理逻辑
This commit is contained in:
parent
ab3e0f2416
commit
bde35c7360
@ -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) {
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -106,7 +106,8 @@ class OrderService extends Service
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!$info) {
|
||||
$data['error_account_oper'] = 1;
|
||||
$data['id'] = $this->db()->insertGetId($data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user