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"); }
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); }
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); }