$platformId, 'pageSize' => $limit, 'currentPage' => $currentPage, ]; // 验证传参. $validate = Loader::validate('UserPlatform'); if (!$validate->scene('userList')->check($getData)) { return [ 'code' => $code, 'msg' => $validate->getError(), 'data' => [], ]; } // 查询平台用户. $offset = (($currentPage - 1) * $limit); $where = [ 'platform_id' => $platformId, 'user_status' => 1, ]; $file = ['platform_user', 'user_name', 'user_platform_rtime', 'user_platform_rip', 'user_platform_id', 'user_nickname', 'user_full_name', 'user_email', 'user_phone']; $userList = $this ->field($file) ->alias('a') ->join('user b', 'a.user_identity = b.user_identity') ->where($where) ->limit($offset, $limit) ->select(); // 查询总数. $userCount = $this ->alias('a') ->join('user b', 'a.user_identity = b.user_identity') ->where($where) ->count(); // 分页. $page = getPage($userCount, $limit, $currentPage); return [ 'code' => 1, 'msg' => lang('MC01005'), 'data' => [ 'userList' => $userList, 'userCount' => $userCount, 'currentPage' => $currentPage, 'page' => $page, ], ]; }//end userList() /** * 删除用户平台关联 */ public function deleteUser() { $code = -2; $userPlatformId = input('id'); $getData = ['user_platform_id' => $userPlatformId]; // 验证传参. $validate = Loader::validate('UserPlatform'); if (!$validate->scene('deleteUser')->check($getData)) { return [ 'code' => $code, 'msg' => $validate->getError(), 'data' => [], ]; } // 查询平台用户. $where = ['user_platform_id' => $userPlatformId]; $this->where($where)->delete(); return [ 'code' => 1, 'msg' => lang('MC01005'), 'data' => [], ]; }//end deleteUser() }