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


PHP comquick2cartHelper::getColumns方法代码示例

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


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

示例1: buildCustomer

 function buildCustomer($store_id)
 {
     $db = JFactory::getDBO();
     global $mainframe, $option;
     $mainframe = JFactory::getApplication();
     $jinput = $mainframe->input;
     $option = $jinput->get('option');
     $order_ids = $this->getOrderIds($store_id);
     $query = "";
     if (!empty($order_ids)) {
         $query = "select * from\n\t\t\t (SELECT  u.* FROM  `#__kart_orders` AS o\n\t\t\t LEFT JOIN  `#__kart_users` AS u ON o.`email` = u.`user_email`\n\t\t\t WHERE u.`address_type` =  'BT'\n\t\t\t AND o.id=u.order_id\n\t\t\t AND u.`order_id` IN (" . $order_ids . " )\n\t\t\t order by u.id  DESC\n\t\t\t) AS newtb ";
         $filter_order = $mainframe->getUserStateFromRequest($option . 'filter_order', 'filter_order', 'firstname', 'cmd');
         $filter_order_Dir = $mainframe->getUserStateFromRequest($option . 'filter_order_Dir', 'filter_order_Dir', 'desc', 'word');
         $filter_search = $mainframe->getUserStateFromRequest($option . 'filter.search', 'filter_search', '', 'string');
         // NOTE:: 1. FIND ALL WHERE AND APPEND TO QUERY
         if (!empty($filter_search)) {
             $where = " WHERE ((`firstname` LIKE \"%" . $filter_search . "%\") OR (`lastname` LIKE \"%" . $filter_search . "%\"))";
             $query .= $where;
         }
         // NOTE:: 2. USE GROUP BY IF ANY
         $groupby = " group by newtb.user_email ";
         $query .= $groupby;
         // NOTE:: 3. USE FILTER
         if ($filter_order) {
             $comquick2cartHelper = new comquick2cartHelper();
             $allowed_fields = $comquick2cartHelper->getColumns('#__kart_users');
             if (in_array($filter_order, $allowed_fields)) {
                 $query .= " ORDER BY " . $filter_order . ' ' . $filter_order_Dir;
             }
         }
     }
     return $query;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:33,代码来源:orders.php


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