Пример #1
0
 public function viewMsg()
 {
     $map['id'] = $_GET['id'];
     $db = new MsgsModel();
     $rs = $db->where($map)->find();
     $this->assign('rs', $rs);
     $date['flag'] = 1;
     //标记为已读;
     if ($rs['flag'] == 0) {
         $db->where($map)->save($date);
     }
     $this->display("WapAdmin:viewMsg");
 }
Пример #2
0
 public function view()
 {
     $map['id'] = $_GET['id'];
     $db = new MsgsModel();
     $rs = $db->where($map)->find();
     if ($rs['id'] === null || $rs['id'] === false) {
         $this->error('你查看的短信不存在,或者已经删除!');
     }
     $this->assign('rs', $rs);
     $this->display('Index:viewMsg');
     $data['flag'] = 1;
     $db->where($map)->save($data);
 }
Пример #3
0
 protected function msgCount()
 {
     $db = new MsgsModel();
     $count = $db->where('flag=0')->count();
     if ($count != 0) {
         $count = "<span class='red'>(" . $count . ")</span>";
     } else {
         unset($count);
     }
     $this->assign('msg_count', $count);
 }