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


PHP KSSystem::getModel方法代码示例

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


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

示例1: getLdmApiData

 /**
  * KSSystem::getLdmApiData()
  *
  * @param mixed $func
  * @param mixed $action
  * @param mixed $params
  * @return
  */
 public static function getLdmApiData($func, $action = null, $params = array())
 {
     $model = KSSystem::getModel('account');
     if (!empty($func) || !empty($model->_auth)) {
         $api_key = null;
         $user = $model->getUserFullInfo();
         if (isset($user->api_key)) {
             $api_key = $user->api_key;
         }
         $link = LDM_API_PATCH . '?func=' . $func . '&api_key=' . $api_key;
         if (!empty($action)) {
             $link .= '&action=' . $action;
         }
         if (!empty($params)) {
             foreach ($params as $key => $param) {
                 $param = str_replace(' ', '%20', $param);
                 $link .= '&' . $key . '=' . $param;
             }
         }
         //echo $link;
         $data_json = file_get_contents($link);
         if (!empty($data_json)) {
             return $data_json;
         }
     }
     return false;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:35,代码来源:system.php

示例2: sendOrderMail

 public static function sendOrderMail($order_id, $admin = false)
 {
     self::onExecuteBefore(array(&$order_id, &$admin));
     $db = JFactory::getDBO();
     JRequest::setVar('id', $order_id);
     $model = KSSystem::getModel('orders');
     $order = $model->getOrder();
     $order->items = KSMOrders::getOrderItems($order_id);
     $query = $db->getQuery(true);
     $query->select('*')->from('#__ksenmart_shipping_fields')->where('shipping_id=' . $order->shipping_id)->where('position=' . $db->quote('address'))->where('published=1')->order('ordering');
     $db->setQuery($query);
     $address_fields = $db->loadObjectList();
     $address = array();
     foreach ($address_fields as $address_field) {
         if ($address_field->system && isset($order->address_fields[$address_field->title])) {
             $value = $order->address_fields[$address_field->title];
         } elseif (!$address_field->system && isset($order->address_fields[$address_field->id])) {
             $value = $order->address_fields[$address_field->id];
         } else {
             $value = '';
         }
         $title = $address_field->system ? JText::_('ksm_cart_shipping_field_' . $address_field->title) : $address_field->title;
         $address[] = $title . ' - ' . $value;
     }
     $order->address_fields = implode(', ', $address);
     $order->customer_name = '';
     if (isset($order->customer_fields['name']) && !empty($order->customer_fields['name'])) {
         $order->customer_name .= $order->customer_fields['name'];
     }
     if (isset($order->customer_fields['last_name']) && !empty($order->customer_fields['last_name'])) {
         $order->customer_name .= $order->customer_fields['last_name'] . ' ';
     }
     if (isset($order->customer_fields['first_name']) && !empty($order->customer_fields['first_name'])) {
         $order->customer_name .= $order->customer_fields['first_name'] . ' ';
     }
     if (isset($order->customer_fields['middle_name']) && !empty($order->customer_fields['middle_name'])) {
         $order->customer_name .= $order->customer_fields['middle_name'];
     }
     $order->phone = isset($order->customer_fields['phone']) && !empty($order->customer_fields['phone']) ? $order->customer_fields['phone'] : '';
     $mail = JFactory::getMailer();
     $params = JComponentHelper::getParams('com_ksenmart');
     $sender = array($params->get('shop_email'), $params->get('shop_name'));
     $content = KSSystem::loadTemplate(array('order' => $order), 'order', 'default', 'mail');
     $mail->isHTML(true);
     $mail->setSender($sender);
     $mail->Subject = 'Новый заказ №' . $order_id;
     $mail->Body = $content;
     if (!$admin) {
         $mail->AddAddress($order->customer_fields['email'], $order->customer_fields['name']);
     } else {
         $mail->AddAddress($params->get('shop_email'), $params->get('shop_name'));
     }
     $mail->Send();
     self::onExecuteAfter();
     return true;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:56,代码来源:orders.php

示例3: display

 public function display($tpl = null)
 {
     $_session = JFactory::getSession();
     $model_account = KSSystem::getModel('account');
     $controller = KSSystem::getController('account');
     $this->title = JText::_('KM_CATALOG_YA_MARKET');
     $model = $this->getModel('yamarket');
     $app = JFactory::getApplication();
     $this->document->addScript(JURI::base() . 'components/com_ksenmart/js/yamarket.js');
     $this->document->addStyleSheet(JURI::base() . 'components/com_ksenmart/css/yamarket.css');
     if (!$model_account->checkAuthorize()) {
         $app->redirect('index.php?option=com_ksenmart&view=account&layout=default_login');
     } else {
         $uid = $model_account->getUserId();
         if (!empty($uid) && $uid > 0) {
             $layout = $this->getLayout();
             $params = $model->getUserParams($uid);
             if (empty($params->ya_site_id)) {
                 $app->redirect('index.php?option=com_ksenmart', 'KM_YA_MARKET_ACCESS_DENIED');
                 exit;
             }
             $shop_info = $model->getUserShopInfo($params->ya_site_id);
             switch ($layout) {
                 case 'stat-placement':
                     $jinput = $app->input;
                     $fromDate = $jinput->get('fromDate', date('Y-m-d'), 'string');
                     $toDate = $jinput->get('toDate', date('Y-m-d'), 'string');
                     $groupBy = $jinput->get('groupBy', 'daily', 'string');
                     $this->path->addItem(JText::_('KM_YA_MARKET'), 'index.php?option=com_ksenmart&view=yamarket');
                     $this->path->addItem(JText::_('KM_YA_HITS_FOR_PLACEMENTS'));
                     $statistic = $model->getShopStatisticByPlacesFull($fromDate, $toDate, $groupBy);
                     $groupByList = JHTML::_('select.genericlist', array('daily' => 'дням', 'weekly' => 'неделям', 'monthly' => 'месяцам'), 'groupBy', 'class="inputbox"', 'value', 'text', $groupBy);
                     $this->assignRef('statistic', $statistic);
                     $this->assignRef('fromDate', $fromDate);
                     $this->assignRef('toDate', $toDate);
                     $this->assignRef('groupByList', $groupByList);
                     break;
                 case 'clicks-report-search':
                     $jinput = $app->input;
                     $groupBy = $jinput->get('groupBy', '-1', 'string');
                     $this->path->addItem(JText::_('KM_YA_MARKET'), 'index.php?option=com_ksenmart&view=yamarket');
                     $this->path->addItem(JText::_('KM_YA_CLICKS_REPORT_SEARCH'));
                     $offersStatistic = $model->getShopOffersStatistic($groupBy, true);
                     $groupByList = JHTML::_('select.genericlist', array('-1' => 'вчера', '-7' => '7 дней', '-30' => '30 дней'), 'groupBy', 'class="inputbox"', 'value', 'text', $groupBy);
                     $this->assignRef('offersStatistic', $offersStatistic);
                     $this->assignRef('groupByList', $groupByList);
                     break;
                 default:
                     $offers = $this->get('ShopOffers');
                     $balance = $this->get('ShopBalance');
                     $statistic = $this->get('ShopStatistic');
                     $statisticByPlaces = $this->get('ShopStatisticByPlaces');
                     $offersStatistic = $this->get('ShopOffersStatistic');
                     /*$test    = $this->get('Test');
                       print_r($test);*/
                     $this->assignRef('params', $params);
                     $this->assignRef('offers', $offers);
                     $this->assignRef('balance', $balance);
                     $this->assignRef('statistic', $statistic);
                     $this->assignRef('statisticByPlaces', $statisticByPlaces);
                     $this->assignRef('offersStatistic', $offersStatistic);
                     $this->assignRef('shop_info', $shop_info);
                     break;
             }
         }
     }
     parent::display($tpl);
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:68,代码来源:view.html.php


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