本文整理汇总了PHP中tmsModel::getItems方法的典型用法代码示例。如果您正苦于以下问题:PHP tmsModel::getItems方法的具体用法?PHP tmsModel::getItems怎么用?PHP tmsModel::getItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tmsModel
的用法示例。
在下文中一共展示了tmsModel::getItems方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getItemList
/**
* Retireve a list of currencies from the database.
* This function is used in the backend for the currency listing, therefore no asking if enabled or not
* @author Max Milbers
* @return object List of currency objects
*/
function getItemList($search = '')
{
//echo $this->getListQuery()->dump();
$items = parent::getItems();
$list_tsmart_product_id = array();
$db = $this->_db;
foreach ($items as &$item) {
$list_tsmart_product_id = $item->list_tsmart_product_id;
$list_tsmart_product_id = explode(',', $list_tsmart_product_id);
$tsmart_hotel_id = $item->tsmart_hotel_id;
$tsmart_hotel_addon_id = $item->tsmart_hotel_addon_id;
$list_tour_tour_class = array();
foreach ($list_tsmart_product_id as $tsmart_product_id) {
$query = $db->getQuery(true);
$query->select('CONCAT("<a href=index.php?option=com_tsmart&view=product&task=edit&tsmart_product_id=",products_en_gb.tsmart_product_id,">",products_en_gb.product_name," </a>","(",GROUP_CONCAT(DISTINCT(service_class.service_class_name) SEPARATOR ","),"."," ",")") AS tour_tour_class')->from('#__tsmart_hotel_id_service_class_id_accommodation_id AS hotel_id_service_class_id_accommodation_id')->leftJoin('#__tsmart_tour_id_service_class_id AS tour_id_service_class_id USING(tsmart_service_class_id)')->leftJoin('#__tsmart_service_class AS service_class ON service_class.tsmart_service_class_id=tour_id_service_class_id.tsmart_service_class_id')->where('hotel_id_service_class_id_accommodation_id.tsmart_hotel_id=' . (int) $tsmart_hotel_id)->leftJoin('#__tsmart_hotel_addon AS hotel_addon ON hotel_addon.tsmart_hotel_id=hotel_id_service_class_id_accommodation_id.tsmart_hotel_id')->where('hotel_addon.tsmart_hotel_addon_id=' . (int) $tsmart_hotel_addon_id)->leftJoin('#__tsmart_tour_id_hotel_addon_id AS tour_id_hotel_addon_id ON tour_id_hotel_addon_id.tsmart_hotel_addon_id=hotel_addon.tsmart_hotel_addon_id')->where('tour_id_hotel_addon_id.tsmart_product_id=' . (int) $tsmart_product_id)->leftJoin('#__tsmart_products AS products ON products.tsmart_product_id=tour_id_hotel_addon_id.tsmart_product_id')->innerJoin('#__tsmart_products_en_gb AS products_en_gb ON products_en_gb.tsmart_product_id=products.tsmart_product_id');
$db->setQuery($query);
$list_tour_tour_class[] = $db->loadResult();
}
$item->tour_tour_class = implode(' ', $list_tour_tour_class);
}
if ($tsmart_product_id = $this->getState('filter.tsmart_product_id')) {
foreach ($items as $key => &$item) {
$list_tsmart_product_id = $item->list_tsmart_product_id;
$list_tsmart_product_id = explode(',', $list_tsmart_product_id);
if (!in_array($tsmart_product_id, $list_tsmart_product_id)) {
unset($items[$key]);
}
}
}
return $items;
}
示例2: getItems
public function getItems()
{
require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmprice.php';
require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmpromotion.php';
$items = parent::getItems();
// TODO: Change the autogenerated stub
// Create Money object that represents 1 EUR
// Access the Money object's monetary value converted to its base units
foreach ($items as &$item) {
$item->sale_price_senior = vmprice::get_sale_price_by_mark_up_and_tax($item->price_senior, $item->mark_up_senior, $item->mark_up_price_senior, $item->tax, $item->mark_up_type);
$item->sale_price_adult = vmprice::get_sale_price_by_mark_up_and_tax($item->price_adult, $item->mark_up_adult, $item->mark_up_price_adult, $item->tax, $item->mark_up_type);
$item->sale_price_teen = vmprice::get_sale_price_by_mark_up_and_tax($item->price_teen, $item->mark_up_teen, $item->mark_up_price_teen, $item->tax, $item->mark_up_type);
$item->sale_price_children1 = vmprice::get_sale_price_by_mark_up_and_tax($item->price_children1, $item->mark_up_children1, $item->mark_up_price_children1, $item->tax, $item->mark_up_type);
$item->sale_price_children2 = vmprice::get_sale_price_by_mark_up_and_tax($item->price_children2, $item->mark_up_children2, $item->mark_up_price_children2, $item->tax, $item->mark_up_type);
$item->sale_price_infant = vmprice::get_sale_price_by_mark_up_and_tax($item->price_infant, $item->mark_up_infant, $item->mark_up_price_infant, $item->tax, $item->mark_up_type);
$item->sale_price_private_room = vmprice::get_sale_price_by_mark_up_and_tax($item->price_private_room, $item->mark_up_private_room, $item->mark_up_price_private_room, $item->tax, $item->mark_up_type);
$item->sale_price_extra_bed = vmprice::get_sale_price_by_mark_up_and_tax($item->price_extra_bed, $item->mark_up_extra_bed, $item->mark_up_price_extra_bed, $item->tax, $item->mark_up_type);
$item->sale_promotion_price_senior = vmpromotion::get_sale_promotion_price_by_mark_up_and_tax($item->promotion_price_senior, $item->mark_up_promotion_senior, $item->mark_up_promotion_price_senior, $item->mark_up_promotion_type, $item->mark_up_promotion_net_price_senior, $item->mark_up_promotion_net_senior, $item->mark_up_promotion_net_type, $item->promotion_tax);
$item->sale_promotion_price_adult = vmpromotion::get_sale_promotion_price_by_mark_up_and_tax($item->promotion_price_adult, $item->mark_up_promotion_adult, $item->mark_up_promotion_price_adult, $item->mark_up_promotion_type, $item->mark_up_promotion_net_price_adult, $item->mark_up_promotion_net_adult, $item->mark_up_promotion_net_type, $item->promotion_tax);
$item->sale_promotion_price_teen = vmpromotion::get_sale_promotion_price_by_mark_up_and_tax($item->promotion_price_teen, $item->mark_up_promotion_teen, $item->mark_up_promotion_price_teen, $item->mark_up_promotion_type, $item->mark_up_promotion_net_price_teen, $item->mark_up_promotion_net_teen, $item->mark_up_promotion_net_type, $item->promotion_tax);
$item->sale_promotion_price_children1 = vmpromotion::get_sale_promotion_price_by_mark_up_and_tax($item->promotion_price_children1, $item->mark_up_promotion_children1, $item->mark_up_promotion_price_children1, $item->mark_up_promotion_type, $item->mark_up_promotion_net_price_children1, $item->mark_up_promotion_net_children1, $item->mark_up_promotion_net_type, $item->promotion_tax);
$item->sale_promotion_price_children2 = vmpromotion::get_sale_promotion_price_by_mark_up_and_tax($item->promotion_price_children2, $item->mark_up_promotion_children2, $item->mark_up_promotion_price_children2, $item->mark_up_promotion_type, $item->mark_up_promotion_net_price_children2, $item->mark_up_promotion_net_children2, $item->mark_up_promotion_net_type, $item->promotion_tax);
$item->sale_promotion_price_infant = vmpromotion::get_sale_promotion_price_by_mark_up_and_tax($item->promotion_price_infant, $item->mark_up_promotion_infant, $item->mark_up_promotion_price_infant, $item->mark_up_promotion_type, $item->mark_up_promotion_net_price_infant, $item->mark_up_promotion_net_infant, $item->mark_up_promotion_net_type, $item->promotion_tax);
$item->sale_promotion_price_private_room = vmpromotion::get_sale_promotion_price_by_mark_up_and_tax($item->promotion_price_private_room, $item->mark_up_promotion_private_room, $item->mark_up_promotion_price_private_room, $item->mark_up_promotion_type, $item->mark_up_promotion_net_price_private_room, $item->mark_up_promotion_net_private_room, $item->mark_up_promotion_net_type, $item->promotion_tax);
$item->sale_promotion_price_extra_bed = vmpromotion::get_sale_promotion_price_by_mark_up_and_tax($item->promotion_price_extra_bed, $item->mark_up_promotion_extra_bed, $item->mark_up_promotion_price_extra_bed, $item->mark_up_promotion_type, $item->mark_up_promotion_net_price_extra_bed, $item->mark_up_promotion_net_extra_bed, $item->mark_up_promotion_net_type, $item->promotion_tax);
$item->full_charge_children1 = $item->tsmart_promotion_price_id ? $item->tour_promotion_price_full_charge_children1 : $item->tour_price_full_charge_children1;
$item->full_charge_children2 = $item->tsmart_promotion_price_id ? $item->tour_promotion_price_full_charge_children2 : $item->tour_price_full_charge_children2;
}
return $items;
}
示例3: getItemList
function getItemList($search = '')
{
//echo $this->getListQuery()->dump();
$items = parent::getItems();
require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmprice.php';
require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmpromotion.php';
foreach ($items as &$item) {
$item->sale_price_adult = vmprice::get_sale_price_by_mark_up_and_tax($item->price_adult, $item->mark_up_adult, $item->mark_up_price_adult, $item->tax, $item->mark_up_type);
$item->sale_promotion_price_adult = vmpromotion::get_sale_promotion_price_by_mark_up_and_tax($item->promotion_price_adult, $item->mark_up_promotion_adult, $item->mark_up_promotion_price_adult, $item->mark_up_promotion_type, $item->mark_up_promotion_net_price_adult, $item->mark_up_promotion_net_adult, $item->mark_up_promotion_net_type, $item->promotion_tax);
}
return $items;
}
示例4: getItems
public function getItems()
{
$items = parent::getItems();
// TODO: Change the autogenerated stub
foreach ($items as &$item) {
$type = $item->mark_up_type;
$tax = $item->tax / 100;
if ($type == 'amount') {
$price_senior = $item->price_senior + $item->mark_up_price_senior;
$item->price_senior = round($price_senior + $price_senior . $tax);
$price_adult = $item->price_adult + $item->mark_up_price_adult;
$item->price_adult = round($price_adult + $price_adult . $tax);
$price_teen = $item->price_teen + $item->mark_up_price_teen;
$item->price_teen = round($price_teen + $price_teen . $tax);
$price_infant = $item->price_infant + $item->mark_up_price_infant;
$item->price_infant = round($price_infant + $price_infant . $tax);
$price_children1 = $item->price_children1 + $item->mark_up_price_children1;
$item->price_children1 = round($price_children1 + $price_children1 . $tax);
$price_children2 = $item->price_children2 + $item->mark_up_price_children2;
$item->price_children2 = round($price_children2 + $price_children2 . $tax);
$price_private_room = $item->price_private_room + $item->mark_up_price_private_room;
$item->price_private_room = round($price_private_room + $price_private_room . $tax);
$extra_bed = $item->extra_bed + $item->mark_up_extra_bed;
$item->extra_bed = round($extra_bed + $extra_bed . $tax);
} else {
$price_senior = $item->price_senior + $item->price_senior . $item->mark_up_senior / 100;
$item->price_senior = round($price_senior + $price_senior . $tax);
$price_adult = $item->price_adult + $item->price_adult * $item->mark_up_adult / 100;
$item->price_adult = round($price_adult + $price_adult . $tax);
$price_teen = $item->price_teen + $item->price_teen * $item->mark_up_teen / 100;
$item->price_teen = round($price_teen + $price_teen . $tax);
$price_infant = $item->price_infant + $item->price_infant * $item->mark_up_infant / 100;
$item->price_infant = round($price_infant + $price_infant . $tax);
$price_children1 = $item->price_children1 + $item->price_children1 * $item->mark_up_children1 / 100;
$item->price_children1 = round($price_children1 + $price_children1 . $tax);
$price_children2 = $item->price_children2 + $item->price_children2 * $item->mark_up_children2 / 100;
$item->price_children2 = round($price_children2 + $price_children2 . $tax);
$price_private_room = $item->price_private_room + $item->price_private_room * $item->mark_up_private_room / 100;
$item->price_private_room = round($price_private_room + $price_private_room . $tax);
$extra_bed = $item->extra_bed + $item->extra_bed * $item->mark_up_extra_bed / 100;
$item->extra_bed = round($extra_bed + $extra_bed . $tax);
}
}
return $items;
}
示例5: getItemList
/**
* Retireve a list of currencies from the database.
* This function is used in the backend for the currency listing, therefore no asking if enabled or not
* @author Max Milbers
* @return object List of currency objects
*/
function getItemList($search = '')
{
$data = parent::getItems();
return $data;
}