有拼有米小程序开发源码分享:
public static function sendTeamCredit($uid,$from_uid,$oid,$team_credit=0.5)
{
$user_info = User::field('spread_uid,level,uid')->where('uid',$uid)->find();
if($user_info)
{
$user_info = $user_info->toArray();
/*if($user_info['level'] == 2)
{*/
User::bcInc($uid,'team_credit',$team_credit,'uid');
UserTeamLog::insert(['uid'=>$uid,'from_uid'=>$from_uid,'add_time'=>time(),'oid'=>$oid,'num'=>$team_credit]);
/* }*/
if( $user_info['spread_uid'] )
{
return self::sendTeamCredit($user_info['spread_uid'],$from_uid,$oid,$team_credit);
}
}
return true;
}