Changeset 10287 for temp/trunk


Ignore:
Timestamp:
2006/12/06 12:07:07 (20 years ago)
Author:
kaki
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • temp/trunk/html/admin/products/index.php

    r10279 r10287  
    121121 
    122122    $where = "del_flg = 0"; 
    123  
     123    $view_where = "del_flg = 0"; 
     124     
    124125    // ÆþÎÏ¥¨¥é¡¼¤Ê¤· 
    125126    if (count($objPage->arrErr) == 0) { 
     
    136137                case 'search_product_id':   // ¾¦ÉÊID 
    137138                    $where .= " AND product_id = ?"; 
     139                    $view_where .= " AND product_id = ?"; 
    138140                    $arrval[] = $val; 
    139141                    break; 
     
    142144                    $where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE classcategory_id1 IN " . $where_in; 
    143145                    $where .= " OR classcategory_id2 IN" . $where_in . ")"; 
     146                    $view_where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE classcategory_id1 IN " . $where_in; 
     147                    $view_where .= " OR classcategory_id2 IN" . $where_in . ")"; 
    144148                    $arrval[] = "%$val%"; 
    145149                    $arrval[] = "%$val%"; 
     150                    $view_where = $where; 
    146151                    break; 
    147152                case 'search_name':         // ¾¦ÉÊ̾ 
    148153                    $where .= " AND name ILIKE ?"; 
     154                    $view_where .= " AND name ILIKE ?"; 
    149155                    $arrval[] = "%$val%"; 
    150156                    break; 
     
    153159                    if($tmp_where != "") { 
    154160                        $where.= " AND $tmp_where"; 
     161                        $view_where.= " AND $tmp_where"; 
    155162                        $arrval = array_merge((array)$arrval, (array)$tmp_arrval); 
    156163                    } 
     
    158165                case 'search_product_code': // ¾¦ÉÊ¥³¡¼¥É 
    159166                    $where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code ILIKE ? GROUP BY product_id)"; 
     167                    $view_where .= " AND EXISTS (SELECT product_id FROM dtb_products_class as cls WHERE cls.product_code ILIKE ? AND prd.product_id = cls.product_id GROUP BY cls.product_id )"; 
    160168                    $arrval[] = "%$val%"; 
    161169                    break; 
     
    163171                    $date = sfGetTimestamp($_POST['search_startyear'], $_POST['search_startmonth'], $_POST['search_startday']); 
    164172                    $where.= " AND update_date >= '" . $_POST['search_startyear'] . "/" . $_POST['search_startmonth']. "/" .$_POST['search_startday'] . "'"; 
     173                    $view_where.= " AND update_date >= '" . $_POST['search_startyear'] . "/" . $_POST['search_startmonth']. "/" .$_POST['search_startday'] . "'"; 
    165174                    break; 
    166175                case 'search_endyear':      // ÅÐÏ¿¹¹¿·Æü¡ÊTO¡Ë 
     
    168177                    $date = date('Y/m/d', strtotime($date) + 86400); 
    169178                    $where.= " AND update_date < date('" . $date . "')"; 
     179                    $view_where.= " AND update_date < date('" . $date . "')"; 
    170180                    break; 
    171181                case 'search_product_flag': //¼ïÊÌ 
     
    174184                    if($search_product_flag != "") { 
    175185                        $where.= " AND product_flag LIKE ?"; 
     186                        $view_where.= " AND product_flag LIKE ?"; 
    176187                        $arrval[] = $search_product_flag;                    
    177188                    } 
     
    192203                        $tmp_where.=")"; 
    193204                        $where.= " $tmp_where"; 
     205                        $view_where.= " $tmp_where"; 
    194206                    } 
    195207                    break; 
     
    234246 
    235247            // ¹Ô¿ô¤Î¼èÆÀ 
    236             //$linemax = $objQuery->count("dtb_products", $where, $arrval); 
     248            $linemax = $objQuery->count("dtb_products as prd", $view_where, $arrval); 
    237249            $objPage->tpl_linemax = $linemax;               // ²¿·ï¤¬³ºÅö¤·¤Þ¤·¤¿¡£É½¼¨ÍÑ 
    238250 
     
    273285                $where_tmp .= sfQuoteSmart($arrval[$i - 1]) . $arrWhere[$i]; 
    274286            } 
     287            $where_tmp .= $view_where; 
    275288            $arrViewWhere["&&noncls_where&&"] = $where_tmp . " " . $objQuery->order . " " .  $objQuery->setlimitoffset($page_max, $startno, true); 
    276289    */       
Note: See TracChangeset for help on using the changeset viewer.