lyhzzz 5 ماه پیش
والد
کامیت
61400d75e6

+ 1 - 0
src/main/java/com/fdkankan/agent/controller/UserController.java

@@ -36,6 +36,7 @@ public class UserController extends BaseController {
      */
     @PostMapping("/list")
     public ResultData list(@RequestBody UserParam param){
+        param.setAgentId(getAgent().getId());
         return ResultData.ok(userService.pageList(param));
     }
 

+ 2 - 0
src/main/java/com/fdkankan/agent/request/UserParam.java

@@ -13,4 +13,6 @@ public class UserParam extends RequestBase {
 
     private String password;
     private String newPassword;
+
+    private Integer agentId;
 }

+ 6 - 1
src/main/resources/mapper/agent/UserMapper.xml

@@ -12,7 +12,12 @@
         <if test="param.email != null and param.email !=''">
             and s.email  like concat ('%',#{param.email},'%')
         </if>
-        and (agent_key is not null or d.agent_id is not null)
+        <if test="param.agentId != null ">
+            and (agent_key is not null or d.agent_id = #{param.agentId} )
+        </if>
+        <if test="param.agentId == null ">
+            and (agent_key is not null or d.agent_id is not null )
+        </if>
         order by s.id desc
 
     </select>