[user_id1, user_id2, ...]] */ public function getValidUsersGroupByGroup(): array { try { $rows = $this->getModel()::where('status', 1) ->field('group_id, user_id') ->select() ->toArray(); $grouped = []; foreach ($rows as $row) { $grouped[$row['group_id']][] = $row['user_id']; } return $grouped; } catch (\Exception $e) { return []; } } /** * @param $groupId * @return array * @author 史晨 * @date 2026/2/27 11:31 * 获取团队用户(分页) */ public function getUserByLevel($groupId) { try { return $this->getModel()::where('status', 1) ->where(['group_id' => $groupId]) ->paginate(20) ->toArray(); } catch (DbException $e) { return []; } } }