|
|
@@ -2272,26 +2272,24 @@ class StoreOrder extends BaseModel
|
|
|
if (!$order['transaction_id']) return true;
|
|
|
$store = SystemStorePoint::get($order['store_id']);
|
|
|
if (!$store) return true;
|
|
|
-
|
|
|
$store_leader = SystemAdmin::where('roles', sys_config('default_store_admin', 7))
|
|
|
->where('store_id', $store['id'])->where('is_del', 0)->where('status', 1)
|
|
|
->find();
|
|
|
- var_dump($store_leader);
|
|
|
-
|
|
|
if (!$store_leader) return true;
|
|
|
$user = User::where('admin_id', $store_leader['id'])->find();
|
|
|
- var_dump($user);
|
|
|
if (!$user) return true;
|
|
|
$p_user_info = WechatUser::get($user['uid']);
|
|
|
- var_dump($p_user_info);
|
|
|
// 选择发起人的订单作为分账的账单
|
|
|
$transaction_id = $order['transaction_id']; // 微信订单号
|
|
|
$out_order_no = $order['order_id'];
|
|
|
|
|
|
// 计算发起人和参与者的分账金额
|
|
|
$price = $order['pay_price'] - $order['pay_postage_sh'] - $order['pay_postage'];
|
|
|
+ var_dump($price);
|
|
|
$p_amount = bcmul($price, $store['sharing'] / 100, 2); //bcmul:2个任意精度数字乘法计算
|
|
|
+ var_dump($p_amount);
|
|
|
$p_separate_account_amount = floor($p_amount * 100); // 发起人分账金额,以分为单位
|
|
|
+ var_dump($p_separate_account_amount);
|
|
|
if ($p_separate_account_amount <= 0) return true;
|
|
|
|
|
|
$receivers[] = array(
|