Esempio n. 1
0
 public function actionMsg()
 {
     if (Yii::app()->request->isAjaxRequest) {
         //         $page=Yii::app()->session['page'];
         //         $pagesize=10;
         //         $page=$pagesize*($page-1);
         $touserid = Yii::app()->request->getParam('touserid');
         $sessionid = Yii::app()->request->getParam('sessionid');
         $params = array('touserid' => $touserid, 'sessionid' => $sessionid);
         $organinfo = ChatService::getuserinfo($touserid);
         $record = ChatService::lists($params);
         //         $touser=Yii::app()->chatmongodb->getDbInstance()->record->find(array("sessionid" => $sessionid))->limit($pagesize)->skip($page);
         //          if($touser){
         //            foreach($touser as $k=>$value){
         //              $datas[$k]=$value;
         //            }
         //        }
         $pageData = array('total_rows' => count($record), 'list_rows' => 10, 'page_name' => 'page', 'ajax_func_name' => '', 'method' => '');
         $page = new Pagination($pageData);
         $page = $page->show(1);
     }
     $this->renderPartial('msg', array('organinfo' => $organinfo, 'record' => $record, 'page' => $page));
 }
Esempio n. 2
0
File: msg.php Progetto: zwq/unpei
            	</a>
            </h3>
            <div class="somebody" style='overflow: auto'>
            	<div class="messages">
<!--                    <h6 class="time"><i>2015-01-23</i></h6>-->
                    <?php 
if (!empty($record) && is_array($record)) {
    foreach ($record as $key => $value) {
        ?>
                  <?php 
        if (isset($value['userid']) && !empty($value['userid'])) {
            $organ = ChatService::getuserinfo($value['userid']);
        }
        $tousertime = $value['time'];
        if (Yii::app()->user->id == $value['userid']) {
            $organs = ChatService::getuserinfo(Yii::app()->user->id);
            ?>
                      <?php 
            if (isset($value['msg']) && !empty($value['msg'])) {
                ?>
                    <ul>
                        <li class="i_two">
                            <span class="headimg"><img src="<?php 
                echo $value['imgsrc'];
                ?>
" /><?php 
                //$organ= ChatService::getuserinfo($value['touser']['userid']);var_dump($organ['OrganName'])
                ?>
</span>
                        <div class="bj">
                        <div class="c_lt">