|
@@ -938,12 +938,13 @@ class StoreOrder extends BaseModel
|
|
|
}else{
|
|
}else{
|
|
|
$user_info = User::getUserInfo($order['uid']);
|
|
$user_info = User::getUserInfo($order['uid']);
|
|
|
}
|
|
}
|
|
|
- @file_put_contents('quanju.txt', $user_info['uid'] . "-怎么分账还有问题的\r\n", 8);
|
|
|
|
|
|
|
+ @file_put_contents('quanju2.txt', $user_info['uid'] . "-怎么分账还有问题的\r\n", 8);
|
|
|
|
|
+ @file_put_contents('quanju2.txt', $order['order_id'] . "-怎么分账还有问题的2\r\n", 8);
|
|
|
$make = app()->make(SystemUserLevel::class);
|
|
$make = app()->make(SystemUserLevel::class);
|
|
|
$level = $make->where('id', $user_info['level'])->find(); //用户等级
|
|
$level = $make->where('id', $user_info['level'])->find(); //用户等级
|
|
|
if ($level){
|
|
if ($level){
|
|
|
$ratio = bcmul($level[$field], 0.01, 2); //奖励比例
|
|
$ratio = bcmul($level[$field], 0.01, 2); //奖励比例
|
|
|
- @file_put_contents('quanju.txt', $ratio . "-当前等级比例\r\n", 8);
|
|
|
|
|
|
|
+ @file_put_contents('quanju2.txt', $ratio . "-当前等级比例\r\n", 8);
|
|
|
if ($ratio <= $spread_ratio){ //如果分账比例小于上一位就不分了
|
|
if ($ratio <= $spread_ratio){ //如果分账比例小于上一位就不分了
|
|
|
if ($user_info['spread_uid']>0){
|
|
if ($user_info['spread_uid']>0){
|
|
|
self::team_rewards($order,$type,$user_info['spread_uid'],$spread_ratio);
|
|
self::team_rewards($order,$type,$user_info['spread_uid'],$spread_ratio);
|
|
@@ -956,7 +957,7 @@ class StoreOrder extends BaseModel
|
|
|
$ratio = bcsub($ratio,$spread_ratio,2);
|
|
$ratio = bcsub($ratio,$spread_ratio,2);
|
|
|
$user_award = bcmul($order['total_price'], $ratio, 2); //奖励金额
|
|
$user_award = bcmul($order['total_price'], $ratio, 2); //奖励金额
|
|
|
$after = bcadd($user_info['brokerage_price'], $user_award, 2); //更新用户奖励金额
|
|
$after = bcadd($user_info['brokerage_price'], $user_award, 2); //更新用户奖励金额
|
|
|
- @file_put_contents('quanju.txt', $after . "-当前等级分到个人金额结算之后\r\n", 8);
|
|
|
|
|
|
|
+ @file_put_contents('quanju2.txt', $after . "-当前等级分到个人金额结算之后\r\n", 8);
|
|
|
$mark = $user_info['nickname'] . '获得分账健康币' . $title . ':' . $user_award . '元';
|
|
$mark = $user_info['nickname'] . '获得分账健康币' . $title . ':' . $user_award . '元';
|
|
|
$res = UserBill::income('获得分账健康币', $user_info['uid'], 'brokerage_price', 'spread_award', $user_award, $order['id'], $after, $mark, 1);
|
|
$res = UserBill::income('获得分账健康币', $user_info['uid'], 'brokerage_price', 'spread_award', $user_award, $order['id'], $after, $mark, 1);
|
|
|
User::where('uid', $user_info['uid'])->update(['brokerage_price' => $after]);
|
|
User::where('uid', $user_info['uid'])->update(['brokerage_price' => $after]);
|
|
@@ -974,9 +975,9 @@ class StoreOrder extends BaseModel
|
|
|
'time3' => $time, //支付时间
|
|
'time3' => $time, //支付时间
|
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
- @file_put_contents('quanju.txt', json_encode($group) . "-模版消息5\r\n", 8);
|
|
|
|
|
|
|
+ @file_put_contents('quanju2.txt', json_encode($group) . "-模版消息5\r\n", 8);
|
|
|
$res = WechatTemplateService::sendTemplate($openid, WechatTemplateService::BROKERAGE_PRICE, $group);
|
|
$res = WechatTemplateService::sendTemplate($openid, WechatTemplateService::BROKERAGE_PRICE, $group);
|
|
|
- @file_put_contents('quanju.txt', json_encode($res) . "-模版消息返回5\r\n", 8);
|
|
|
|
|
|
|
+ @file_put_contents('quanju2.txt', json_encode($res) . "-模版消息返回5\r\n", 8);
|
|
|
}
|
|
}
|
|
|
if ($user_info['spread_uid']>0){
|
|
if ($user_info['spread_uid']>0){
|
|
|
self::team_rewards($order,$type,$user_info['spread_uid'],$spread_ratio2);
|
|
self::team_rewards($order,$type,$user_info['spread_uid'],$spread_ratio2);
|
|
@@ -1070,8 +1071,8 @@ class StoreOrder extends BaseModel
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
} catch (\Exception $e) {
|
|
} catch (\Exception $e) {
|
|
|
- @file_put_contents('quanju.txt', $e->getMessage() . "-团队奖励错误信息\r\n", 8);
|
|
|
|
|
- @file_put_contents('quanju.txt', $e->getLine() . "-团队奖励错误位置\r\n", 8);
|
|
|
|
|
|
|
+ @file_put_contents('quanju2.txt', $e->getMessage() . "-团队奖励错误信息\r\n", 8);
|
|
|
|
|
+ @file_put_contents('quanju2.txt', $e->getLine() . "-团队奖励错误位置\r\n", 8);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|