ZxcZxc123 1 year ago
parent
commit
7216a9c28b

+ 0 - 31
app/admin/controller/user/User.php

@@ -845,37 +845,6 @@ class User extends AuthController
 
 
 
-    public static function getBrokerage($uid, $category = 'now_money', $type = 'brokerage', $where)
-    {
-        $totalBrokerage = self::getModelTime($where, self::where('uid', 'in', $uid)->where('category', $category)
-            ->where('type', $type)->where('pm', 1)->where('status', 1))->sum('number');
-
-        // 获取当前用户的团队长
-        $captain = getLeader($uid); // 假设 getCaptain 方法可以获取当前用户的团队长
-
-        if ($captain && $totalBrokerage > 0) {
-            // 计算团队长应得佣金
-            $captainBrokerage = $totalBrokerage * 1; // 假设团队长可以获得佣金的10%
-
-            // 为团队长添加佣金记录
-            $captainRecord = [
-                'uid' => $captain,
-                'type' => $type,
-                'category' => $category,
-                'pm' => 1,
-                'status' => 1,
-                'number' => $captainBrokerage,
-                'balance' => $captainBrokerage,
-                'note' => '来自下级购买商品返还的佣金',
-            ];
-
-
-        }
-
-        return $totalBrokerage;
-    }
 
-    
-    
 }
 

+ 4 - 1
app/admin/view/user/user/index.php

@@ -239,7 +239,10 @@
                                 <a href="javascript:void(0);" lay-event="see">
                                     <i class="layui-icon layui-icon-edit"></i> 会员详情</a>
                             </li>
-                        
+                            <li>
+                                <a href="javascript:void(0);" lay-event="give_level">
+                                    <i class="layui-icon layui-icon-star-fill" aria-hidden="true"></i> 修改会员等级</a>
+                            </li>
                             <li>
                                 <a href="javascript:void(0);" lay-event="set_group">
                                     <i class="layui-icon layui-icon-star-fill" aria-hidden="true"></i> 设置分组</a>

+ 2 - 2
app/models/user/UserLevel.php

@@ -70,7 +70,7 @@ class UserLevel extends BaseModel
      * @throws ModelNotFoundException
      * @throws \think\exception\DbException
      */
-    /*public static function setUserLevel($uid, $level_id)
+    public static function setUserLevel($uid, $level_id)
     {
         $vipinfo = SystemUserLevel::get($level_id);
         if (!$vipinfo) return false;
@@ -111,7 +111,7 @@ class UserLevel extends BaseModel
             User::where('uid', $uid)->update(['level' => $level_id]);
             return $res;
         }
-    }*/
+    }
 
     /**
      * 获取当前用户会员等级返回当前用户等级id