Skip to content

Instantly share code, notes, and snippets.

@balibali
Created April 22, 2010 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save balibali/375140 to your computer and use it in GitHub Desktop.
Save balibali/375140 to your computer and use it in GitHub Desktop.
Index: webapp/lib/db/member.php
===================================================================
--- webapp/lib/db/member.php (リビジョン 20393)
+++ webapp/lib/db/member.php (作業コピー)
@@ -293,16 +293,13 @@
$order = " ORDER BY c_member_id DESC";
$sql = "SELECT c_member_id" . $from . $where . $order;
- // 検索設定を公開にしていないメンバーを除外
$result_ids = db_get_col($sql, $params);
- foreach ($result_ids as $key => $result_id) {
- $c_member_config = db_member_c_member_config4c_member_id($result_id);
- if ($c_member_config['IS_SEARCH_RESULT'] === '0') {
- unset($result_ids[$key]);
- }
- }
- $result_ids = array_merge($result_ids);
+ // 検索設定を公開にしていないメンバーを除外
+ $sql = "SELECT c_member_id FROM c_member_config WHERE name = 'IS_SEARCH_RESULT' AND value = '0'";
+ $ids = db_get_col($sql);
+ $result_ids = array_diff($result_ids, $ids);
+
foreach ($profiles as $key => $value) {
$sql = "SELECT c_member_id FROM c_member_profile";
$sql .= " WHERE c_profile_id = ? AND public_flag = 'public'";
@@ -318,12 +315,13 @@
$sql .= " AND c_profile_option_id = ?";
$params[] = intval($value['c_profile_option_id']);
}
- $sql .= " ORDER BY c_member_id DESC";
$ids = db_get_col($sql, $params);
- $result_ids = array_values(array_intersect($result_ids, $ids));
+ $result_ids = array_intersect($result_ids, $ids);
}
+ $result_ids = array_values($result_ids);
+
$start = ($page - 1) * $page_size;
$list = array();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment