瀏覽代碼

超级福利

董荣正 1 月之前
父節點
當前提交
f338503213
共有 2 個文件被更改,包括 9 次插入2 次删除
  1. 2 1
      application/api/controller/Airdrop.php
  2. 7 1
      application/common/model/UserModel.php

+ 2 - 1
application/api/controller/Airdrop.php

@@ -13,7 +13,7 @@ use app\common\model\LedgerFrozenChangeModel;
 use app\common\model\LedgerWalletModel;
 use app\common\model\ProductOrder;
 use app\common\model\LedgerTokenChangeModel;
-
+use think\Log;
 //空投
 class Airdrop extends Api
 {
@@ -99,6 +99,7 @@ class Airdrop extends Api
             Db::commit();
         } catch (\Exception $e) {
             Db::rollback();
+            Log::error($e->getMessage(),'setSuperWeal');
             $this->error($e->getMessage());
         }
         $this->success('', $result);

+ 7 - 1
application/common/model/UserModel.php

@@ -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');
+        }
     }
 
     /**