public function view_replyMessageFormAliSite() { $msgids = isset($_GET['msgids']) ? trim($_GET['msgids']) : ''; if ($msgids === '') { //没指定id $msgdata = array('data' => array('请指定要回复的message'), 'link' => 'index.php?mod=messagefilter&act=getAliSiteList'); goErrMsgPage($msgdata); exit; } /*----- 获得message信息 -----*/ $idar = explode(',', $msgids); //数组 $idar = array_map('intval', $idar); //转换成 $msg_obj = new messageModel(); $msg_list = $msg_obj->getMessageInfoAliSite($idar); foreach ($msg_list as &$value) { $value['createtime'] = trunToLosangeles('Y-m-d H:i:s', $value['createtimestamp']); //echo $value['relationId']; $value['commnuni'] = $msg_obj->getRlatedSiteMessage($value['relationId']); $value['orderids'] = array(); $temparr = array(); $bigestid = 0; $idregion = array(); foreach ($value['commnuni'] as &$cval) { $cval['createtimestamp'] = trunToLosangeles('Y:m:d H:i:s', $cval['createtimestamp']); if (1 == $cval['role'] && !empty($cval['orderUrl']) && !empty($cval['orderId'])) { if (!in_array($cval['orderId'], $temparr)) { $value['orderids'][] = array('account' => $cval['receiverid'], 'orderid' => $cval['orderId']); $temparr[] = $cval['orderId']; } } if ($bigestid < $cval['message_id']) { $bigestid = $cval['message_id']; } if ($cval['role'] == 1) { $idar[] = $cval['id']; if ($cval['hasread'] == 0) { $idregion[] = $cval['message_id']; } } $cval['content'] = str_replace("\n", '</br>', $cval['content']); } // print_r($idregion); sort($idregion); if (count($idregion) > 0) { $refirst = $idregion[0]; $reend = $idregion[count($idregion) - 1]; $msg_obj->markAsReadByMsgId_site($idregion); //标记为已读状态 $msg_obj->markUser_site($idregion, $_SESSION['globaluserid']); //标记回复人id } else { $refirst = 0; $reend = 0; } $value['idregion_h'] = $refirst; $value['idregion_e'] = $reend; $value['bigestid'] = $bigestid; } //print_r($msg_list);exit; /*----- 获得message信息 -----*/ /*----- 获得模板信息 -----*/ $tpl_obj = new MessageTemplateModel(); $tpl_list = $tpl_obj->getTplList($_SESSION['globaluserid'], array('id', 'name', 'iscommon', 'incommonuse', 'content'), 2); $this->smarty->assign('tpllist', $tpl_list); /*----- 获得模板信息 -----*/ /*----- 获得文件夹分类列表 -----*/ $categorylist = new messagecategoryModel(); $cat_list = $categorylist->getAllCategoryInfoList(' and is_delete=0 ', 2); $this->smarty->assign('catlist', $cat_list); /*----- 获得文件夹分类列表 -----*/ // print_r($msg_list);exit; $this->smarty->assign('msglist', $msg_list); $this->smarty->assign('sec_menue', 4); $this->smarty->assign('toplevel', 0); $this->smarty->assign('toptitle', 'message回复'); $this->smarty->display('msgreplyalisite.htm'); }