Changeset 21433
- Timestamp:
- 2012/02/03 11:07:25 (12 years ago)
- Location:
- branches/version-2_12-dev/data/class
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/SC_Product.php
r21420 r21433 75 75 $table = <<< __EOS__ 76 76 dtb_products AS alldtl 77 LEFT JOIN dtb_products_class78 ON alldtl.product_id = dtb_products_class.product_id79 LEFT JOIN dtb_product_categories80 ON alldtl.product_id = dtb_product_categories.product_id81 77 __EOS__; 82 78 $objQuery->setGroupBy('alldtl.product_id'); … … 118 114 $table = <<< __EOS__ 119 115 dtb_products AS alldtl 120 LEFT JOIN dtb_products_class 121 ON alldtl.product_id = dtb_products_class.product_id 122 LEFT JOIN dtb_product_categories 123 ON alldtl.product_id = dtb_product_categories.product_id 124 __EOS__; 125 $objQuery->setGroupBy('alldtl.product_id'); 126 $sql_base = $objQuery->getSql('alldtl.product_id',$table); 127 return $objQuery->getOne( "SELECT count(*) FROM ( $sql_base ) as t" , $arrVal); 116 __EOS__; 117 return $objQuery->count($table, '', $arrVal); 128 118 } 129 119 -
branches/version-2_12-dev/data/class/pages/products/LC_Page_Products_List.php
r21420 r21433 269 269 if (strlen($searchCondition["where_category"]) >= 1) { 270 270 $dtb_product_categories = "(SELECT * FROM dtb_product_categories WHERE ".$searchCondition["where_category"].")"; 271 $arrval_order = array_merge($searchCondition['arrvalCategory'], $searchCondition['arrvalCategory']);271 $arrval_order = $searchCondition['arrvalCategory']; 272 272 } else { 273 273 $dtb_product_categories = 'dtb_product_categories'; … … 276 276 ( 277 277 SELECT 278 T3.rank 278 T3.rank * 2147483648 + T2.rank 279 279 FROM 280 280 $dtb_product_categories T2 … … 285 285 LIMIT 1 286 286 ) DESC 287 ,( 288 SELECT 289 T2.rank 290 FROM 291 $dtb_product_categories T2 292 JOIN dtb_category T3 293 USING (category_id) 294 WHERE T2.product_id = alldtl.product_id 295 ORDER BY T3.rank DESC, T2.rank DESC 296 LIMIT 1 297 ) DESC 298 ,product_id 287 ,product_id DESC 299 288 __EOS__; 300 289 $objQuery->setOrder($order); … … 425 414 426 415 if (strlen($searchCondition["where_category"]) >= 1) { 427 $searchCondition['where'] .= " AND dtb_product_categories.".$searchCondition["where_category"];416 $searchCondition['where'] .= ' AND EXISTS (SELECT * FROM dtb_product_categories WHERE ' . $searchCondition["where_category"] . ' AND product_id = alldtl.product_id)'; 428 417 $searchCondition['arrval'] = array_merge($searchCondition['arrval'], $searchCondition['arrvalCategory']); 429 418 }
Note: See TracChangeset
for help on using the changeset viewer.