Changeset 20202
- Timestamp:
- 2011/02/19 18:29:53 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products.php
r20201 r20202 124 124 if (count($this->arrErr) == 0) { 125 125 $where = "del_flg = 0"; 126 $view_where = "del_flg = 0";127 126 foreach ($arrParam as $key => $val) { 128 127 if($val == "") { 129 128 continue; 130 129 } 131 $this->buildQuery($key, $where, $ view_where, $arrval, $objFormParam, $objDb);130 $this->buildQuery($key, $where, $arrval, $objFormParam, $objDb); 132 131 } 133 132 … … 274 273 * クエリパラメータは, SC_FormParam の入力値から取得する. 275 274 * 276 * 構築内容は, 引数の $where , $view_where及び $arrValues にそれぞれ追加される.275 * 構築内容は, 引数の $where 及び $arrValues にそれぞれ追加される. 277 276 * 278 277 * @param string $key 検索条件のキー 279 278 * @param string $where 構築する WHERE 句 280 * @param string $view_where 構築する WHERE 句281 279 * @param array $arrValues 構築するクエリパラメータ 282 280 * @param SC_FormParam $objFormParam SC_FormParam インスタンス … … 284 282 * @return void 285 283 */ 286 function buildQuery($key, &$where, &$ view_where, &$arrValues, &$objFormParam, &$objDb) {284 function buildQuery($key, &$where, &$arrValues, &$objFormParam, &$objDb) { 287 285 $dbFactory = SC_DB_DBFactory::getInstance(); 288 286 switch ($key) { … … 290 288 case 'search_product_id': 291 289 $where .= " AND product_id = ?"; 292 $view_where .= " AND product_id = ?";293 290 $arrValues[] = sprintf('%d', $objFormParam->getValue($key)); 294 291 break; … … 296 293 case 'search_product_code': 297 294 $where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code ILIKE ? GROUP BY product_id)"; 298 $view_where .= " AND EXISTS (SELECT product_id FROM dtb_products_class as cls WHERE cls.product_code ILIKE ? AND dtb_products.product_id = cls.product_id GROUP BY cls.product_id )";299 295 $arrValues[] = sprintf('%%%s%%', $objFormParam->getValue($key)); 300 296 break; … … 302 298 case 'search_name': 303 299 $where .= " AND name LIKE ?"; 304 $view_where .= " AND name LIKE ?";305 300 $arrValues[] = sprintf('%%%s%%', $objFormParam->getValue($key)); 306 301 break; … … 310 305 if($tmp_where != "") { 311 306 $where.= " AND product_id IN (SELECT product_id FROM dtb_product_categories WHERE " . $tmp_where . ")"; 312 $view_where.= " AND product_id IN (SELECT product_id FROM dtb_product_categories WHERE " . $tmp_where . ")";313 307 $arrValues = array_merge((array)$arrValues, (array)$tmp_Values); 314 308 } … … 331 325 $tmp_where .= ")"; 332 326 $where .= " $tmp_where "; 333 $view_where .= " $tmp_where";334 327 } 335 328 break; … … 340 333 $objFormParam->getValue('search_startday')); 341 334 $where.= " AND update_date >= ?"; 342 $view_where.= " AND update_date >= ?";343 335 $arrValues[] = $date; 344 336 break; … … 349 341 $objFormParam->getValue('search_endday'), true); 350 342 $where.= " AND update_date <= ?"; 351 $view_where.= " AND update_date <= ?";352 343 $arrValues[] = $date; 353 344 break; … … 358 349 foreach($objFormParam->getValue($key) as $param) { 359 350 $where .= "?,"; 360 $view_where .= "?,";361 351 $arrValues[] = $param; 362 352 } 363 353 $where = preg_replace("/,$/", "))", $where); 364 $view_where = preg_replace("/,$/", "))", $where);365 354 } 366 355 break;
Note: See TracChangeset
for help on using the changeset viewer.