|
@@ -110,8 +110,7 @@ class UserModel extends Model
|
|
|
public static function updateUserLevel(int $uid, int $parentId)
|
|
public static function updateUserLevel(int $uid, int $parentId)
|
|
|
{
|
|
{
|
|
|
if (!empty($parentId)) {
|
|
if (!empty($parentId)) {
|
|
|
- $paths = UserPathModel::where('user_id', $parentId)->order('distance', 'asc')->column('parent_id');
|
|
|
|
|
- $paths[]= $parentId;
|
|
|
|
|
|
|
+ $paths = UserPathModel::where('user_id', $uid)->order('distance', 'asc')->column('parent_id');
|
|
|
foreach ($paths as $item)
|
|
foreach ($paths as $item)
|
|
|
{
|
|
{
|
|
|
$parent = self::where('id', $item)->find();
|
|
$parent = self::where('id', $item)->find();
|