本文整理汇总了PHP中arr::alsort方法的典型用法代码示例。如果您正苦于以下问题:PHP arr::alsort方法的具体用法?PHP arr::alsort怎么用?PHP arr::alsort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类arr
的用法示例。
在下文中一共展示了arr::alsort方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processAction
public function processAction(&$controller, $params)
{
$this->assignEmptyParams($params, 2, array('true'));
list($showdetail, $filters) = $params;
$channellist_view = new View('callmanager/channellist');
$channellist_view->summaryfields = freeswitch_callmanager_Driver::getSummaryFields();
$channellist_view->detailfields = freeswitch_callmanager_Driver::getDetailFields();
$callManagerObj = new callManager();
$input = Input::instance();
if (!$filters) {
$filters = array();
$filters['state'] = $input->post('state_filters');
}
try {
$channellist = $this->executeAction(array());
arr::alfilter($channellist, $filters);
arr::alsort($channellist, $input->post('channel_order'));
foreach (array_keys($channellist) as $curkey) {
$channellist[$curkey]['actions'] = callmanagerHelper::getFunctionLinksForCall($channellist[$curkey], $channellist[$curkey]['uuid']);
}
$channellist_view->channellist = $channellist;
$channellist_view->updated = date('r');
$channellist_view->showdetail = $showdetail;
$channellist_view->render(TRUE);
} catch (ESL_Exception $e) {
echo 'An error has occured: ' . $e->getMessage() . '<br>';
if (strpos($e->getMessage(), 'Not connected')) {
echo 'This indicates that Freeswitch is not running, mod_event_socket is not configured, or the system is unable to log in.';
}
} catch (callmanagerException $e) {
echo 'An error has occured: ' . $e->getMessage() . '<br>';
}
exit;
}
示例2: getAgentList
public function getAgentList()
{
try {
$input = Input::instance();
$queueId = $input->post('queueid');
$agentlistview = new View('callcenter_supervisor/agentlist');
$agentlistview->status_fields = self::$agent_status_fields;
$agentlistview->showdetail = true;
$agentlistview->updated = date('r');
$callcenter_manager_obj = new CallCenterManager();
$agentlistview->agentStatus = $callcenter_manager_obj->getQueueAgentStatus($queueId);
$filters = array();
$filters['status'] = $input->post('agentstatus_filters');
foreach ($agentlistview->agentStatus as $agent => $agentdata) {
$locationObj = Doctrine::getTable('Location')->findOneByDomain($agentdata['domain']);
$agentObj = Doctrine::getTable('callcenter_agent')->findOneBycca_loginidAndcca_locationid($agentdata['loginid'], $locationObj->location_id);
$agentlistview->agentStatus[$agent]['displayname'] = $agentObj->cca_displayname;
$agentlistview->agentStatus[$agent]['id'] = $agentObj->cca_id;
foreach (self::$agent_date_diffs as $fieldname => $fieldparts) {
$d1 = key($fieldparts) === 'now' ? 'now' : $agentdata[key($fieldparts)];
$d2 = current($fieldparts) === 'now' ? 'now' : $agentdata[current($fieldparts)];
$agentlistview->agentStatus[$agent][$fieldname] = dttm::timestampdiff($d1, $d2);
}
foreach (self::$agent_date_fields as $fieldname => $formated_fieldname) {
$agentlistview->agentStatus[$agent][$formated_fieldname] = date('r', $agentlistview->agentStatus[$agent][$fieldname]);
}
}
arr::alfilter($agentlistview->agentStatus, $filters);
arr::alsort($agentlistview->agentStatus, $input->post('agent_order'));
$agentlistview->render(TRUE);
} catch (Exception $e) {
echo 'An error has occured: ' . $e->getMessage() . '<br>';
if (strpos($e->getMessage(), 'Not connected')) {
echo 'This indicates that Freeswitch is not running, mod_event_socket is not configured, or the system is unable to log in.';
}
}
exit;
}