Ver código fonte

后台-推荐人/节点人/身份修改-1.取消了被修改人手机号和昵称展示,2.修改后的推荐人节点人不展示uid改为展示手机号,3.根据不同adminid和修改内容修改默认备注

xupuyuan 11 meses atrás
pai
commit
c667b266ad
1 arquivos alterados com 15 adições e 46 exclusões
  1. 15 46
      app/controller/admin/user/User.php

+ 15 - 46
app/controller/admin/user/User.php

@@ -815,7 +815,11 @@ class User extends BaseController
815
     {
815
     {
816
         $spread_account = $this->request->param('spread_account');
816
         $spread_account = $this->request->param('spread_account');
817
         $adminId = $this->request->adminId();
817
         $adminId = $this->request->adminId();
818
-        $mark = $this->getMark($adminId,'spread');
818
+        $mark = $this->request->param('mark');
819
+        if (empty($mark)) {
820
+            $adminInfo = $this->request->adminInfo();
821
+            $mark = $adminInfo['account'].'修改用户推荐人';
822
+        }
819
         $olld_id = Db::name('user')->where('uid', $id)->value('spread_uid')??0;
823
         $olld_id = Db::name('user')->where('uid', $id)->value('spread_uid')??0;
820
         if($repository->update_spread($id,$spread_account,$mark,$olld_id,$adminId)){
824
         if($repository->update_spread($id,$spread_account,$mark,$olld_id,$adminId)){
821
             return app('json')->success("修改成功");
825
             return app('json')->success("修改成功");
@@ -852,7 +856,11 @@ class User extends BaseController
852
         $level_account_old = $this->request->param('level_account_old');
856
         $level_account_old = $this->request->param('level_account_old');
853
         $account = explode('(', $level_account_old)[0];
857
         $account = explode('(', $level_account_old)[0];
854
         $adminId = $this->request->adminId();
858
         $adminId = $this->request->adminId();
855
-        $mark = $this->getMark($adminId,'level');
859
+        $mark = $this->request->param('mark');
860
+        if (empty($mark)) {
861
+            $adminInfo = $this->request->adminInfo();
862
+            $mark = $adminInfo['account'].'修改用户节点人';
863
+        }
856
         if (!$id) {
864
         if (!$id) {
857
             return app('json')->fail("参数丢失");
865
             return app('json')->fail("参数丢失");
858
         }
866
         }
@@ -878,7 +886,11 @@ class User extends BaseController
878
         $old_identity_id = $this->request->param('old_identity_id');
886
         $old_identity_id = $this->request->param('old_identity_id');
879
         $new_identity_id = $this->request->param('new_identity_id');
887
         $new_identity_id = $this->request->param('new_identity_id');
880
         $adminId = $this->request->adminId();
888
         $adminId = $this->request->adminId();
881
-        $mark = $this->getMark($adminId,'identity');
889
+        $mark = $this->request->param('mark');
890
+        if (empty($mark)) {
891
+            $adminInfo = $this->request->adminInfo();
892
+            $mark = $adminInfo['account'].'修改用户身份';
893
+        }
882
         if (empty($id) || empty($old_identity_id) || empty($new_identity_id)) {
894
         if (empty($id) || empty($old_identity_id) || empty($new_identity_id)) {
883
             return app('json')->fail("参数丢失");
895
             return app('json')->fail("参数丢失");
884
         }
896
         }
@@ -2100,47 +2112,4 @@ class User extends BaseController
2100
             ->toArray();
2112
             ->toArray();
2101
         return app('json')->success($query, '获取成功');
2113
         return app('json')->success($query, '获取成功');
2102
     }
2114
     }
2103
-    /**
2104
-     * 通过后台管理员id和修改信息来区别默认备注
2105
-     */
2106
-    protected function getMark($adminId, string $type)
2107
-    {
2108
-        $mark = $this->request->param('mark');
2109
-        if ($mark) {
2110
-            return $mark;
2111
-        }
2112
-        $defaultMap = [
2113
-            'spread'   => '后台管理员修改用户推荐人',
2114
-            'level'     => '后台管理员修改用户节点人',
2115
-            'identity' => '后台管理员修改用户身份',
2116
-        ];
2117
-        $markMap = [
2118
-            'spread' => [
2119
-                1 => 'admin修改用户推荐人',
2120
-                10 => '商户+文章管理员修改用户推荐人',
2121
-                25 => '运营管理员修改用户推荐人',
2122
-                27 => '订单发货管理员修改用户推荐人',
2123
-                28 => '财务管理员修改用户推荐人',
2124
-                29 => '超级管理员修改用户推荐人',
2125
-            ],
2126
-            'level' => [
2127
-                1 => 'admin修改用户节点人',
2128
-                10 => '商户+文章管理员修改用户节点人',
2129
-                25 => '运营管理员修改用户节点人',
2130
-                27 => '订单发货管理员修改用户节点人',
2131
-                28 => '财务管理员修改用户节点人',
2132
-                29 => '超级管理员修改用户节点人',
2133
-            ],
2134
-            'identity' => [
2135
-                1 => 'admin修改用户身份',
2136
-                10 => '商户+文章管理员修改用户身份',
2137
-                25 => '运营管理员修改用户身份',
2138
-                27 => '订单发货管理员修改用户身份',
2139
-                28 => '财务管理员修改用户身份',
2140
-                29 => '超级管理员修改用户身份',
2141
-            ]
2142
-        ];
2143
-        return $markMap[$type][$adminId] ?? ($defaultMap[$type] ?? '哈基米修改用户信息');
2144
-    }
2145
-
2146
 }
2115
 }