想在阅读量增加代码中加一个“更新时间”
public function hitsAction() {<br /> $id = (int)$this->get('id');<br /> if (empty($id)) exit;<br /> $data = $this->db->setTableName('content')->find($id, 'hits');<br /> $hits = $data['hits'] + 1;<br /> $this->db->setTableName('content')->update(array('hits'=>$hits), 'id=?' , $id);<br /> echo "document.write('$hits');";<br /> }
<br />public function hitsAction() {<br /> $id = (int)$this->get('id');<br /> if (empty($id)) exit;<br /> $data = $this->db->setTableName('content')->find($id, 'hits');<br /> $hits = $data['hits'] + 1;<br /> $t = time();<br /> $this->db->setTableName('content')->update(array('hits'=>$hits,'time'=>$t), 'id=?' , $id);<br /> echo "document.write('$hits');";<br />}<br />