|
|
@@ -9,7 +9,7 @@ use think\Exception;
|
|
|
use app\common\model\LedgerWalletModel;
|
|
|
use fast\Asset;
|
|
|
use think\Model;
|
|
|
-
|
|
|
+use think\Log;
|
|
|
/**
|
|
|
* 会员模型
|
|
|
*/
|
|
|
@@ -148,6 +148,9 @@ class UserModel extends Model
|
|
|
*/
|
|
|
public static function updateUserLevel(int $uid, int $parentId, $addressLevel)
|
|
|
{
|
|
|
+ try {
|
|
|
+
|
|
|
+
|
|
|
if (!empty($parentId)) {
|
|
|
$model = new ProductOrder();
|
|
|
$paths = UserPathModel::where('user_id', $uid)->order('distance', 'asc')->column('parent_id');
|
|
|
@@ -188,6 +191,9 @@ class UserModel extends Model
|
|
|
}
|
|
|
//
|
|
|
return self::where('id', $uid)->update(['address_level'=> $addressLevel+1, 'is_super'=>self::Super]);
|
|
|
+ } catch (\Throwable $e) {
|
|
|
+ Log::error($e->getMessage(),'updateUserLevel');
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|