|
@@ -138,7 +138,7 @@ class Notify extends Api
|
|
|
//四大收益,视频,音频,私聊,礼物
|
|
|
public function shouyi($user_id,$gold,$table,$table_id){
|
|
|
//精确小数点
|
|
|
- bcscale(1);
|
|
|
+ bcscale(2);
|
|
|
|
|
|
//枚举
|
|
|
$table_enum = [
|
|
@@ -220,16 +220,14 @@ class Notify extends Api
|
|
|
|
|
|
//充值后奖金
|
|
|
public function recharge($user_id,$gold,$table,$payorder_id){
|
|
|
- //精确小数点
|
|
|
- bcscale(1);
|
|
|
|
|
|
//充值者本人
|
|
|
$userinfo = Db::name('user')->field('id,username,group_id,intro_uid,invite_uid,gender')->where('id',$user_id)->find();
|
|
|
|
|
|
//个人直推邀请充值
|
|
|
- if(!empty($userinfo['invite_uid']) && $userinfo['gender'] == 1){
|
|
|
+ if(!empty($userinfo['invite_uid']) && $userinfo['gender'] == 1 && empty($userinfo['intro_uid'])){
|
|
|
$recharge_invite_rate = config('site.invite_recharge_rate');
|
|
|
- $jewel = bcdiv(bcmul($gold,$recharge_invite_rate),100);
|
|
|
+ $jewel = bcdiv(bcmul($gold,$recharge_invite_rate,1),100,1);
|
|
|
|
|
|
$result = model('Wallet')->lockChangeAccountRemain($userinfo['invite_uid'],'jewel',$jewel,41, $userinfo['username'].'充值','pay_order',$payorder_id);
|
|
|
if($result['status']===false)
|
|
@@ -248,6 +246,8 @@ class Notify extends Api
|
|
|
$intro_userinfo = Db::name('user')->field('id,username,group_id,intro_uid,gender')->where('id',$userinfo['intro_uid'])->find();
|
|
|
if(empty($intro_userinfo)){return true;}
|
|
|
|
|
|
+ //精确小数点
|
|
|
+ bcscale(2);
|
|
|
|
|
|
//上级是一级邀请A,本人为B普、B1(二级邀请人),贡献给A
|
|
|
if($intro_userinfo['group_id'] == 3){
|