Changeset 18609 for tmp/version-2_5-test/data/class/pages/admin/products/LC_Page_Admin_Products_ProductRank.php
- Timestamp:
- 2010/03/11 10:35:11 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tmp/version-2_5-test/data/class/pages/admin/products/LC_Page_Admin_Products_ProductRank.php
r18007 r18609 57 57 */ 58 58 function process() { 59 $ conn = new SC_DBConn();59 $objQuery = new SC_Query(); 60 60 $objView = new SC_AdminView(); 61 61 $objSess = new SC_Session(); … … 93 93 $this->tpl_pageno = ""; 94 94 break; 95 96 case 'renumber': 97 $sql = <<< __EOS__ 98 UPDATE dtb_product_categories 99 SET 100 rank = 101 ( 102 SELECT COUNT(*) 103 FROM dtb_product_categories t_in 104 WHERE t_in.category_id = dtb_product_categories.category_id 105 AND ( 106 t_in.rank < dtb_product_categories.rank 107 OR ( 108 t_in.rank = dtb_product_categories.rank 109 AND t_in.product_id < dtb_product_categories.product_id 110 ) 111 ) 112 ) + 1 113 WHERE dtb_product_categories.category_id = ? 114 __EOS__; 115 $objQuery->query($sql, array($_POST['parent_category_id'])); 116 break; 117 95 118 default: 96 119 break; … … 117 140 function lfGetProduct($category_id) { 118 141 $objQuery = new SC_Query(); 119 $col = "T2.product_id, name, main_list_image, T2.rank, product_code"; 120 $table = "vw_products_nonclass AS noncls " 121 . " LEFT JOIN dtb_product_categories AS T2 USING (product_id)"; 122 $where = "del_flg = 0 AND T2.category_id = ?"; 142 $col = "product_id, name, main_list_image, product_code_min, product_code_max, status"; 143 $table = "vw_products_allclass AS allcls"; 144 $where = "del_flg = 0 AND category_id = ?"; 123 145 124 146 // 行数の取得 … … 130 152 $startno = $objNavi->start_row; 131 153 $this->tpl_start_row = $objNavi->start_row; 132 $this->tpl_strnavi = $objNavi->strnavi; 133 $this->tpl_pagemax = $objNavi->max_page; 134 $this->tpl_disppage = $objNavi->now_page; 154 $this->tpl_strnavi = $objNavi->strnavi; // Navi表示文字列 155 $this->tpl_pagemax = $objNavi->max_page; // ページ最大数(「上へ下へ」表示判定用) 156 $this->tpl_disppage = $objNavi->now_page; // 表示ページ番号(「上へ下へ」表示判定用) 135 157 136 158 // 取得範囲の指定(開始行番号、行数のセット) 137 if(DB_TYPE != "mysql")$objQuery->setlimitoffset(SEARCH_PMAX, $startno);159 $objQuery->setlimitoffset(SEARCH_PMAX, $startno); 138 160 139 $objQuery->setorder(" rankDESC");161 $objQuery->setorder("product_rank DESC, product_id DESC"); 140 162 141 163 $arrRet = $objQuery->select($col, $table, $where, array($category_id));
Note: See TracChangeset
for help on using the changeset viewer.