mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
Update UserUpgradeService.php
This commit is contained in:
parent
4452bfd77a
commit
3febde6ab8
@ -46,8 +46,9 @@ class UserUpgradeService extends Service
|
|||||||
if (empty($agent['vip_code'])) return [0, '代理无推荐资格'];
|
if (empty($agent['vip_code'])) return [0, '代理无推荐资格'];
|
||||||
if (stripos($agent['path'], "-{$uid}-") !== false) return [0, '不能绑定下属'];
|
if (stripos($agent['path'], "-{$uid}-") !== false) return [0, '不能绑定下属'];
|
||||||
// 组装代理数据
|
// 组装代理数据
|
||||||
$result = [0, '绑定代理失败'];
|
|
||||||
$this->app->db->transaction(function () use ($user, $agent, $mod, &$result) {
|
try {
|
||||||
|
$this->app->db->transaction(function () use ($user, $agent, $mod) {
|
||||||
// 更新用户代理
|
// 更新用户代理
|
||||||
$path1 = rtrim($agent['path'] ?: '-', '-') . "-{$agent['id']}-";
|
$path1 = rtrim($agent['path'] ?: '-', '-') . "-{$agent['id']}-";
|
||||||
$this->app->db->name('DataUser')->where(['id' => $user['id']])->update([
|
$this->app->db->name('DataUser')->where(['id' => $user['id']])->update([
|
||||||
@ -64,11 +65,12 @@ class UserUpgradeService extends Service
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 更新用户等级
|
|
||||||
$this->upgrade($user['id']);
|
|
||||||
$result = [1, '绑定代理成功'];
|
|
||||||
});
|
});
|
||||||
return $result;
|
$this->upgrade($user['id']);
|
||||||
|
return [1, '绑定代理成功'];
|
||||||
|
} catch (\Exception $exception) {
|
||||||
|
return [0, "绑定代理失败, {$exception->getMessage()}"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user