mirror of
https://github.com/tateck-develop/AvocadoEdition_Light.git
synced 2026-01-02 13:32:04 +09:00
Merge pull request #2 from commurunning/fix/skin/board/character/list-order-sql
Fix list pagination
This commit is contained in:
commit
0181eca6f4
1 changed files with 14 additions and 1 deletions
|
|
@ -83,9 +83,17 @@ if (!$sca) {
|
|||
$arr_notice = array_filter($arr_notice);
|
||||
$board_notice_count = count($arr_notice);
|
||||
|
||||
if($board_notice_count > 0) {
|
||||
if($sst == 'wr_id') {
|
||||
// 전체 목록인 경우, 게시글 개수에서 공지글 제외
|
||||
$total_count -= $board_notice_count;
|
||||
}
|
||||
else if($board_notice_count > 0) {
|
||||
$pair_str = implode("' or wr_id = '", $arr_notice);
|
||||
$pair_str = "wr_id = '".$pair_str."'";
|
||||
// 페어 목록인 경우, 페어 목록만 추출하고 게시글 개수를 공지글로 한정
|
||||
$pair_str = "({$pair_str}) and wr_type = 'pair'";
|
||||
$total_count = $board_notice_count;
|
||||
|
||||
$pair_sql = " select * from {$write_table} where {$pair_str} order by wr_ing desc, wr_subject asc ";
|
||||
$notice_result = sql_query($pair_sql);
|
||||
|
||||
|
|
@ -153,6 +161,11 @@ if ($sca || $stx) {
|
|||
$sql = " select * from {$write_table} where wr_is_comment = 0 ";
|
||||
if(!empty($notice_array))
|
||||
$sql .= " and wr_id not in (".implode(', ', $notice_array).") ";
|
||||
// 전체 목록인 경우, 캐릭터 게시글만 추출. 페어 목록인 경우, 페어 게시글만 추출
|
||||
if($sst=='wr_id' || $board_notice_count < 1)
|
||||
$sql .= " and wr_type != 'pair'";
|
||||
else
|
||||
$sql .= " and wr_type = 'pair'";
|
||||
$sql .= " {$sql_order} limit {$from_record}, $page_rows ";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue