本文整理匯總了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;
}