天天看點

TP架構中多條件篩選

$pid =I('pid');

        $year = I('year');

        $productType = I('productType');

        //搜尋條件 where

        $_where = "cinfo.uid=$uid and cg.type=1 and cg.status=1";

        if($pid){

            $_where .= " and c.pid=$pid";

        }

        if($year){

            $_where .= " and c.year=$year";

        }

        if($productType){

            $_where .= " and c.productType=$productType";

        }      

你要保守你心,勝過保守一切。

作者:劉俊濤的部落格​​

繼續閱讀