本文整理匯總了PHP中ps_DB::loadResultArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP ps_DB::loadResultArray方法的具體用法?PHP ps_DB::loadResultArray怎麽用?PHP ps_DB::loadResultArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ps_DB
的用法示例。
在下文中一共展示了ps_DB::loadResultArray方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getProductSKU
function getProductSKU( $limit=0, $how=null, $category_ids=array(), $featuredProducts='no' , $specific_product_ids='', $source='filter', $catfilter='') {
global $my, $mosConfig_offset;
$database = new ps_DB();
$where = $this->buildConditionSql($source, $catfilter, $category_ids, $specific_product_ids);
if($limit>0) {
$limit = "LIMIT $limit";
} else {
$limit = "";
}
$query = "SELECT distinct(p.product_sku) FROM #__{vm}_product AS p";
$query .= "\nJOIN #__{vm}_product_category_xref as pc ON p.product_id=pc.product_id";
$query .= "\nJOIN #__{vm}_category as c ON pc.category_id=c.category_id";
$query .= "\n WHERE p.product_publish = 'Y' AND c.category_publish = 'Y' AND product_parent_id=0 ";
if( CHECK_STOCK && PSHOP_SHOW_OUT_OF_STOCK_PRODUCTS != "1") {
$query .= " AND product_in_stock > 0 ";
}
if( $featuredProducts=='yes' ) {
$query .= "\n AND product_special = 'Y' ";
}
$query .= $where;
switch( $how ) {
case 'random':
$query .= "\n ORDER BY RAND() $limit";
break;
case 'newest':
$query .= "\n ORDER BY p.cdate DESC $limit";
break;
case 'oldest':
$query .= "\n ORDER BY p.cdate ASC $limit";
break;
default:
$query .= "\n ORDER BY p.cdate DESC $limit";
break;
}
$database->setQuery( $query );
$rows = $database->loadResultArray();//var_dump($rows);die;
return $rows;
}