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


PHP CustomerMessage::getTotalCustomerMessages方法代码示例

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


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

示例1: renderList

    public function renderList()
    {
        $this->addRowAction('view');
        $this->addRowAction('delete');
        $this->_select = '
 			CONCAT(c.`firstname`," ",c.`lastname`) as customer, cl.`name` as contact, l.`name` as language, group_concat(message) as messages,
 			(
				SELECT IFNULL(CONCAT(LEFT(e.`firstname`, 1),". ",e.`lastname`), "--")
				FROM `' . _DB_PREFIX_ . 'customer_message` cm2
				INNER JOIN ' . _DB_PREFIX_ . 'employee e
					ON e.`id_employee` = cm2.`id_employee`
				WHERE cm2.id_employee > 0
					AND cm2.`id_customer_thread` = a.`id_customer_thread`
				ORDER BY cm2.`date_add` DESC LIMIT 1
			) as employee';
        $this->_join = '
			LEFT JOIN `' . _DB_PREFIX_ . 'customer` c
				ON c.`id_customer` = a.`id_customer`
			LEFT JOIN `' . _DB_PREFIX_ . 'customer_message` cm
				ON cm.`id_customer_thread` = a.`id_customer_thread`
			LEFT JOIN `' . _DB_PREFIX_ . 'lang` l
				ON l.`id_lang` = a.`id_lang`
			LEFT JOIN `' . _DB_PREFIX_ . 'contact_lang` cl
				ON (cl.`id_contact` = a.`id_contact` AND cl.`id_lang` = ' . (int) $this->context->language->id . ')';
        $this->_group = 'GROUP BY cm.id_customer_thread';
        $this->_orderBy = 'id_customer_thread';
        $this->_orderWay = 'DESC';
        $contacts = CustomerThread::getContacts();
        $categories = Contact::getCategoriesContacts();
        $params = array($this->l('Total threads') => $all = CustomerThread::getTotalCustomerThreads(), $this->l('Threads pending') => $pending = CustomerThread::getTotalCustomerThreads('status LIKE "%pending%"'), $this->l('Total number of customer messages') => CustomerMessage::getTotalCustomerMessages('id_employee = 0'), $this->l('Total number of employee messages') => CustomerMessage::getTotalCustomerMessages('id_employee != 0'), $this->l('Unread threads') => $unread = CustomerThread::getTotalCustomerThreads('status = "open"'), $this->l('Closed threads') => $all - ($unread + $pending));
        $this->tpl_list_vars = array('contacts' => $contacts, 'categories' => $categories, 'params' => $params);
        return parent::renderList();
    }
开发者ID:Eximagen,项目名称:3m,代码行数:33,代码来源:AdminCustomerThreadsController.php


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