本文整理汇总了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;
}