本文整理汇总了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;
}