本文整理汇总了PHP中ps_DB::loadObjectList方法的典型用法代码示例。如果您正苦于以下问题:PHP ps_DB::loadObjectList方法的具体用法?PHP ps_DB::loadObjectList怎么用?PHP ps_DB::loadObjectList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ps_DB
的用法示例。
在下文中一共展示了ps_DB::loadObjectList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getItems
function getItems(&$params) {
global $CURRENCY_DISPLAY, $sess, $mm_action_url, $VM_LANG;
$db = new ps_DB;
if($rows = $this->getProductSKU( $this->NumberOfProducts, $this->SortMethod, $this->vmcategories, $this->featuredProducts, $this->specific_product_ids, $this->source, $this->catfilter ))
{
$ps_product = new ps_product;
$ps_product_category = new ps_product_category;
$pro_skus = implode("','", $rows);
$limit = $this->NumberOfProducts;
if($limit>0) {
$limit = "LIMIT $limit";
} else {
$limit = "";
}
$q = "SELECT product_id, product_name, product_parent_id, product_thumb_image, product_desc, product_full_image FROM #__{vm}_product AS p WHERE product_sku in ('$pro_skus')";
switch( $this->SortMethod ) {
case 'random':
$q .= "\n ORDER BY RAND() $limit";
break;
case 'newest':
$q .= "\n ORDER BY p.cdate DESC $limit";
break;
case 'oldest':
$q .= "\n ORDER BY p.cdate ASC $limit";
break;
default:
$q .= "\n ORDER BY p.cdate DESC $limit";
break;
}
$db->setQuery( $q );
$items = $db->loadObjectList();
//var_dump($items);die;
foreach($items as &$item) {
$product_id = $item->product_id;
$cid = $ps_product_category->get_cid( $product_id );
$product_name = $item->product_name;
$item->title = $product_name;
if ($item->product_parent_id) {
$url = "?page=shop.product_details&category_id=$cid&flypage=".$ps_product->get_flypage($item->product_parent_id);
$url .= "&product_id=" . $item->product_parent_id;
} else {
$url = "?page=shop.product_details&category_id=$cid&flypage=".$ps_product->get_flypage($item->product_id);
$url .= "&product_id=" . $item->product_id;
}
$product_link = $sess->url($mm_action_url. "index.php" . $url);
$item->link = $product_link;
$product_thumb_image = $item->product_full_image;
//$img = $this->image_url( $product_thumb_image, "alt=\"".$product_name."\"");
$item->image = IMAGEPATH.'product/'.$product_thumb_image;
$item->fulltext = $item->product_desc;
$item->introtext = $item->product_desc;
$price_base = $this->get_price($ps_product, $item->product_id);
$price_ps = $ps_product->get_price($item->product_id, true);
if (_SHOW_PRICES == '1' && $this->show_price) {
// Show price, but without "including X% tax"
$item->price = $CURRENCY_DISPLAY->getFullValue($price_base[1]);
}
if (USE_AS_CATALOGUE != 1 && $this->show_addtocart
&& isset($price_ps) && $price_ps['product_price'] // Product must have a price to add it to cart
/*&& !$ps_product->product_has_attributes($item->product_id, true) // Parent Products and Products with attributes can't be added to cart this way*/
) {
$url = "?page=shop.cart&func=cartAdd&product_id=" . $item->product_id;
$addtocart_link = $sess->url($mm_action_url. "index.php" . $url);
$item->addtocart_link = $addtocart_link;
}
}
return $this->update($params, $items);
} else return array();
}
示例2: getUserFields
/**
* This function allows you to get an object list of user fields
*
* @param string $section The section the fields belong to (e.g. 'registration' or 'account')
* @param boolean $required_only
* @param mixed $sys When left empty, doesn't filter by sys
* @return array
*/
function getUserFields($section = 'registration', $required_only = false, $sys = '', $exclude_delimiters = false, $exclude_skipfields = false)
{
$db = new ps_DB();
$q = "SELECT f.* FROM `#__{vm}_userfield` f" . "\n WHERE f.published=1";
if ($section != 'bank' && $section != '') {
$q .= "\n AND f.`{$section}`=1";
} elseif ($section == 'bank') {
$q .= "\n AND f.name LIKE '%bank%'";
}
if ($exclude_delimiters) {
$q .= "\n AND f.type != 'delimiter' ";
}
if ($required_only) {
$q .= "\n AND f.required=1";
}
if ($sys !== '') {
if ($sys == '1') {
$q .= "\n AND f.sys=1";
} elseif ($sys == '0') {
$q .= "\n AND f.sys=0";
}
}
if ($exclude_skipfields) {
$q .= "\n AND FIND_IN_SET( f.name, '" . implode(',', ps_userfield::getSkipFields()) . "') = 0 ";
}
$q .= "\n ORDER BY f.ordering";
$db->setQuery($q);
$userFields = $db->loadObjectList();
return $userFields;
}
示例3: foreach
<input type="hidden" name="page" value="order.sc_change_shipping">
<input type="hidden" name="fn" value="showallbutton">
<input type="hidden" name="option" value="com_virtuemart">
<input type="hidden" value="<?php
echo $db->f("order_id");
?>
" name="order_id">
</form>
<?php
}
?>
<?php
$dblog = new ps_DB();
$q = "SELECT * FROM order_log WHERE order_id='{$order_id}' ORDER BY id DESC";
$dblog->query($q);
$log_list = $dblog->loadObjectList();
?>
<br>
<button style="width: 145px;" class="btn getallbuttons" onclick="toggleLogs();">Показать логи</button>
<table style="display: none;" id="form_logs" class="adminlist" border="1">
<tr>
<th style="text-align: center;">Категория события</th>
<th style="text-align: center;">Наименование</th>
<th style="text-align: center;">Старое значение</th>
<th style="text-align: center;">Новое значение</th>
<th style="text-align: center;">Идентификатор пользователя</th>
<th style="text-align: center;">Время изменения</th>
</tr>
<?php
foreach ($log_list as $arr) {
?>
示例4: recalcorder
function recalcorder($order_id, $r)
{
$db = new ps_DB();
$query = "SELECT * FROM #__{vm}_orders";
$db->Query($query);
$list = $db->loadObjectList();
if ($db->getErrorNum()) {
echo $db->stderr();
return false;
}
$ps_order = new ps_order($order_id);
$ps_order->{$ps_order_change} = new ps_order_change($order_id);
$ps_order_change->recalc_order($order_id);
}
示例5: getOrderInfo
function getOrderInfo($order_id)
{
$qv = "SELECT *\n\t\t FROM `#__{vm}_orders` as o\n\t\t left join `#__{vm}_order_user_info` as oi on o.order_id = oi.order_id \n\t\t WHERE o.order_id='" . $order_id . "'";
$db_ap = new ps_DB();
$db_ap->setQuery($qv);
$result = $db_ap->loadObjectList();
return $result[0];
}