问题修复

main
limu 11 months ago
parent 5fd2c5b29f
commit 77ca4959f0
  1. 14
      app/common/repositories/user/UserRepository.php
  2. 2
      app/controller/api/Auth.php

@ -946,9 +946,9 @@ class UserRepository extends BaseRepository
*/
public function bindSpread(User $user, int $spreadUid,$is_new = false)
{
try{
if ($spreadUid && !$user->spread_uid && $user->uid != $spreadUid && ($spread = $this->dao->get($spreadUid)) && $spread->spread_uid != $user->uid && !$spread->cancel_time) {
$config = systemConfig(['extension_limit', 'extension_limit_day', 'integral_user_give']);
$config = systemConfig(['extension_limit', 'extension_limit_day', 'integral_user_give'])??[];
event('user.spread.before', compact('user', 'spreadUid'));
Db::transaction(function () use ($spread, $spreadUid, $user, $config,$is_new) {
if(!empty($is_new)){
@ -963,8 +963,10 @@ class UserRepository extends BaseRepository
}
$spread->spread_count++;
if(!empty($is_new)){
if ($user->isNew) {
//加到log日志
ValueContributionLog::getDB()->insert([
'type' => 2,
@ -974,7 +976,7 @@ class UserRepository extends BaseRepository
'memo' => '邀请好友获得100品宣积分',
'user_id' => $user->spread_uid,
]);
}
$user2 = userModel::where('uid', $user->spread_uid)->find();
$user2->brand_integral += 100;
@ -1005,6 +1007,10 @@ class UserRepository extends BaseRepository
app()->make(UserBrokerageRepository::class)->incMemberValue($user->uid, 'member_share_num', 0);
event('user.spread', compact('user', 'spreadUid'));
}
}catch (\Exception $e){
print_r($e->getTrace());exit;
}
}
public function userPosition($key, $uid)

@ -849,7 +849,7 @@ class Auth extends BaseController
foreach ($nodes as $node) {
if ($node['sid'] == $parentId && $node[$field] > 0) {
$count += $node[$field];
$count += 1;
$count += $this->countSpReferrals($nodes, $node['uid'], $field, $visited);
}

Loading…
Cancel
Save