当前位置: 首页>>代码示例>>PHP>>正文


PHP KSSystem::loadDbItem方法代码示例

本文整理汇总了PHP中KSSystem::loadDbItem方法的典型用法代码示例。如果您正苦于以下问题:PHP KSSystem::loadDbItem方法的具体用法?PHP KSSystem::loadDbItem怎么用?PHP KSSystem::loadDbItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KSSystem的用法示例。


在下文中一共展示了KSSystem::loadDbItem方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getCurrency

 function getCurrency()
 {
     $this->onExecuteBefore('getCurrency');
     $id = JRequest::getInt('id');
     $currency = KSSystem::loadDbItem($id, 'currencies');
     $this->onExecuteAfter('getCurrency', array(&$currency));
     return $currency;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:8,代码来源:currencies.php

示例2: getDiscount

 function getDiscount()
 {
     $this->onExecuteBefore('getDiscount');
     $id = JRequest::getInt('id');
     $discount = KSSystem::loadDbItem($id, 'discounts');
     $discount = KSMedia::setItemMedia($discount, 'discount');
     if (empty($discount->from_date)) {
         $discount->from_date = date('d.m.Y');
     }
     if (empty($discount->to_date)) {
         $discount->to_date = date('d.m.Y');
     }
     if (empty($discount->categories)) {
         $discount->categories = '{}';
     }
     if (empty($discount->manufacturers)) {
         $discount->manufacturers = '{}';
     }
     if (empty($discount->regions)) {
         $discount->regions = '{}';
     }
     if (empty($discount->params)) {
         $discount->params = '{}';
     }
     if (empty($discount->user_actions)) {
         $discount->user_actions = '{}';
     }
     if (empty($discount->user_groups)) {
         $discount->user_groups = '{}';
     }
     if (empty($discount->info_methods)) {
         $discount->info_methods = '{}';
     }
     if (empty($discount->type)) {
         $discount->type = $this->getState('discount_type');
     }
     $discount->categories = json_decode($discount->categories, true);
     $discount->manufacturers = json_decode($discount->manufacturers, true);
     $discount->regions = json_decode($discount->regions, true);
     $discount->params = json_decode($discount->params, true);
     $discount->user_actions = json_decode($discount->user_actions, true);
     $discount->user_groups = json_decode($discount->user_groups, true);
     $discount->info_methods = json_decode($discount->info_methods, true);
     $discount->from_date = date('d.m.Y', strtotime($discount->from_date));
     $discount->to_date = date('d.m.Y', strtotime($discount->to_date));
     $this->setState('discount_type', $discount->type);
     $this->setState('discount_params', $discount->params);
     $this->setState('discount_id', $discount->id);
     $this->onExecuteAfter('getDiscount', array(&$discount));
     return $discount;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:51,代码来源:discounts.php

示例3: getManufacturer

 function getManufacturer()
 {
     $this->onExecuteBefore('getManufacturer');
     $id = JRequest::getInt('id');
     $manufacturer = KSSystem::loadDbItem($id, 'manufacturers');
     $manufacturer = KSMedia::setItemMedia($manufacturer, 'manufacturer');
     $this->onExecuteAfter('getManufacturer', array(&$manufacturer));
     return $manufacturer;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:9,代码来源:catalog.php

示例4: getRate

 function getRate()
 {
     $this->onExecuteBefore('getRate');
     $id = JRequest::getInt('id');
     $rate = KSSystem::loadDbItem($id, 'commentrates');
     $this->onExecuteAfter('getRate', array(&$rate));
     return $rate;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:8,代码来源:comments.php

示例5: getPriceWithProperties

 public static function getPriceWithProperties($product_id, $properties = array(), $price = null)
 {
     $db = JFactory::getDBO();
     if (empty($price)) {
         $product = KSSystem::loadDbItem($product_id, 'products');
         $price = KSMPrice::getPriceInCurrentCurrency($product->price, $product->price_type);
     }
     foreach ($properties as $property_id => $values) {
         $query = $db->getQuery(true);
         $query->select('edit_price')->from('#__ksenmart_properties');
         $query->where('id=' . $property_id);
         $db->setQuery($query);
         $edit_price = $db->loadResult();
         if ($edit_price == 1) {
             foreach ($values as $value_id) {
                 $query = $db->getQuery(true);
                 $query->select('price')->from('#__ksenmart_product_properties_values');
                 $query->where('property_id=' . $property_id)->where('value_id=' . $value_id)->where('product_id=' . $product_id);
                 $db->setQuery($query);
                 $under_price = $db->loadResult();
                 if ($under_price && !empty($under_price)) {
                     $under_price_act = substr($under_price, 0, 1);
                     switch ($under_price_act) {
                         case '+':
                             $price += substr($under_price, 1, strlen($under_price) - 1);
                             break;
                         case '-':
                             $price -= substr($under_price, 1, strlen($under_price) - 1);
                             break;
                         case '/':
                             $price = $price / substr($under_price, 1, strlen($under_price) - 1);
                             break;
                         case '*':
                             $price = $price * substr($under_price, 1, strlen($under_price) - 1);
                             break;
                         default:
                             $price += $under_price;
                     }
                 }
             }
         }
     }
     return $price;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:44,代码来源:product.php

示例6: getRegion

 function getRegion()
 {
     $this->onExecuteBefore('getRegion');
     $id = JRequest::getInt('id');
     $region = KSSystem::loadDbItem($id, 'regions');
     $region = KSMedia::setItemMedia($region, 'region');
     $this->onExecuteAfter('getRegion', array(&$region));
     return $region;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:9,代码来源:countries.php

示例7: getPayment

 function getPayment($vars = array())
 {
     $this->onExecuteBefore('getPayment', array(&$vars));
     $id = JRequest::getInt('id');
     $payment = KSSystem::loadDbItem($id, 'payments');
     $payment = KSMedia::setItemMedia($payment, 'payment');
     if (empty($payment->params)) {
         $payment->params = '{}';
     }
     if (empty($payment->regions)) {
         $payment->regions = '{}';
     }
     if (empty($payment->type)) {
         $payment->type = $this->getState('payment_type');
     }
     $payment->params = json_decode($payment->params, true);
     $payment->regions = json_decode($payment->regions, true);
     $this->setState('payment_type', $payment->type);
     $this->setState('payment_params', $payment->params);
     $this->setState('payment_id', $payment->id);
     $this->onExecuteAfter('getPayment', array(&$payment));
     return $payment;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:23,代码来源:payments.php

示例8: getProperty

 function getProperty()
 {
     $this->onExecuteBefore('getProperty');
     $id = JRequest::getInt('id');
     $property = KSSystem::loadDbItem($id, 'properties');
     $property->type = $id > 0 ? $property->type : 'text';
     $query = $this->_db->getQuery(true);
     $query->select('category_id')->from('#__ksenmart_product_categories_properties')->where('property_id=' . $id);
     $this->_db->setQuery($query);
     $property->categories = $this->_db->loadColumn();
     $query = $this->_db->getQuery(true);
     $query->select('*')->from('#__ksenmart_property_values')->where('property_id=' . $id)->order('ordering');
     $this->_db->setQuery($query);
     $property->values = $this->_db->loadObjectList();
     $this->onExecuteAfter('getProperty', array(&$property));
     return $property;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:17,代码来源:properties.php

示例9: getOrderStatus

 function getOrderStatus()
 {
     $this->onExecuteBefore('getOrderStatus');
     $id = JRequest::getInt('id');
     $orderstatus = KSSystem::loadDbItem($id, 'orderstatuses');
     $this->onExecuteAfter('getOrderStatus', array(&$orderstatus));
     return $orderstatus;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:8,代码来源:orders.php

示例10: getUserField

 function getUserField()
 {
     $this->onExecuteBefore('getUserField');
     $id = JRequest::getInt('id');
     $userfield = KSSystem::loadDbItem($id, 'userfields');
     $this->onExecuteAfter('getUserField', array(&$userfield));
     return $userfield;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:8,代码来源:users.php

示例11: getShipping

 function getShipping()
 {
     $this->onExecuteBefore('getShipping');
     $id = JRequest::getInt('id');
     $shipping = KSSystem::loadDbItem($id, 'shippings');
     $shipping = KSMedia::setItemMedia($shipping, 'shipping');
     $shipping->user_fields = array();
     $shipping->address_fields = array();
     if (empty($shipping->params)) {
         $shipping->params = '{}';
     }
     if (empty($shipping->regions)) {
         $shipping->regions = '{}';
     }
     if (empty($shipping->type)) {
         $shipping->type = $this->getState('shipping_type');
     }
     $shipping->params = json_decode($shipping->params, true);
     $shipping->regions = json_decode($shipping->regions, true);
     if ($id > 0) {
         $query = $this->_db->getQuery(true);
         $query->select('*')->from('#__ksenmart_shipping_fields')->where('shipping_id=' . (int) $shipping->id)->where('position=' . $this->_db->quote('customer'))->order('ordering');
         $this->_db->setQuery($query);
         $shipping->user_fields = $this->_db->loadAssocList('id');
         foreach ($shipping->user_fields as &$user_field) {
             if ($user_field['type'] == 'select') {
                 $query = $this->_db->getQuery(true);
                 $query->select('*')->from('#__ksenmart_shipping_fields_values')->where('field_id=' . $user_field['id']);
                 $this->_db->setQuery($query);
                 $user_field['values'] = $this->_db->loadObjectList('id');
             }
         }
         $query = $this->_db->getQuery(true);
         $query->select('*')->from('#__ksenmart_shipping_fields')->where('shipping_id=' . (int) $shipping->id)->where('position=' . $this->_db->quote('address'))->order('ordering');
         $this->_db->setQuery($query);
         $shipping->address_fields = $this->_db->loadAssocList('id');
         foreach ($shipping->address_fields as &$address_field) {
             if ($address_field['type'] == 'select') {
                 $query = $this->_db->getQuery(true);
                 $query->select('*')->from('#__ksenmart_shipping_fields_values')->where('field_id=' . $address_field['id']);
                 $this->_db->setQuery($query);
                 $address_field['values'] = $this->_db->loadObjectList('id');
             }
         }
     }
     $this->setState('shipping_type', $shipping->type);
     $this->setState('shipping_params', $shipping->params);
     $this->setState('shipping_id', $shipping->id);
     $this->onExecuteAfter('getShipping', array(&$shipping));
     return $shipping;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:51,代码来源:shippings.php


注:本文中的KSSystem::loadDbItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。