ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 10765


Ignore:
Timestamp:
Feb 15, 2009, 9:54:43 PM (11 years ago)
Author:
ogawa
Message:

#3619:管理画面のブラックリスト管理ページで使われているSQLを単純なものに分割

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/stable-2.12.x/webapp/modules/admin/lib/db_admin.php

    r10704 r10765  
    29702970function db_admin_c_blacklist_list($page, $page_size)
    29712971{
    2972     $sql = 'SELECT b.c_blacklist_id,ms.c_member_id,b.info,m.nickname,b.easy_access_id ' .
    2973             ' FROM c_blacklist AS b' .
    2974             ' LEFT JOIN c_member_secure AS ms ON b.easy_access_id = ms.easy_access_id'.
    2975             ' LEFT JOIN c_member AS m ON ms.c_member_id = m.c_member_id' .
    2976             ' ORDER BY b.c_blacklist_id ASC';
     2972    $sql = 'SELECT * FROM c_blacklist ORDER BY c_blacklist_id';
    29772973    $list = db_get_all_page($sql, $page, $page_size);
     2974
     2975    $sql = 'SELECT c_member_id FROM c_member_secure WHERE easy_access_id = ?';
     2976    foreach ($list as $key => $blacklist) {
     2977        if ($blacklist['easy_access_id'] && $c_member_id = db_get_one($sql, array($blacklist['easy_access_id']))) {
     2978            $c_member = db_member_c_member4c_member_id_LIGHT($c_member_id);
     2979
     2980            $list[$key]['c_member_id'] = $c_member_id;
     2981            $list[$key]['nickname'] = $c_member['nickname'];
     2982        }
     2983    }
    29782984
    29792985    $sql = 'SELECT count(*) FROM c_blacklist';
     
    30153021function db_admin_c_blacklist($c_blacklist_id)
    30163022{
    3017     $sql = 'SELECT b.c_blacklist_id,ms.c_member_id,b.info,m.nickname,b.easy_access_id ' .
    3018             ' FROM c_blacklist AS b' .
    3019             ' LEFT JOIN c_member_secure AS ms ON b.easy_access_id = ms.easy_access_id'.
    3020             ' LEFT JOIN c_member AS m ON ms.c_member_id = m.c_member_id' .
    3021             ' WHERE b.c_blacklist_id = ? '
    3022             ;
    3023     $param = array($c_blacklist_id);
    3024     $blacklist = db_get_row($sql, $param);
     3023    $sql = 'SELECT * FROM c_blacklist WHERE c_blacklist_id = ?';
     3024    $params = array($c_blacklist_id);
     3025    $blacklist = db_get_row($sql, $params);
     3026
     3027    $sql = 'SELECT c_member_id FROM c_member_secure WHERE easy_access_id = ?';
     3028    if (!empty($blacklist['easy_access_id']) && $c_member_id = db_get_one($sql, array($blacklist['easy_access_id']))) {
     3029        $c_member = db_member_c_member4c_member_id_LIGHT($c_member_id);
     3030
     3031        $blacklist['c_member_id'] = $c_member_id;
     3032        $blacklist['nickname'] = $c_member['nickname'];
     3033    }
    30253034
    30263035    return $blacklist;
Note: See TracChangeset for help on using the changeset viewer.