news = Media::news(empty($id) ? input('id') : $id); return $this->fetch(); } /** * 显示图文内容 * @param integer $id * @return mixed * @throws \think\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException * @throws \think\exception\PDOException */ public function view($id = 0) { $where = ['id' => empty($id) ? input('id') : $id]; Db::name('WechatNewsArticle')->where($where)->update(['read_num' => Db::raw('read_num+1')]); return $this->fetch('', ['info' => Db::name('WechatNewsArticle')->where($where)->find()]); } public function text() { return $this->fetch(); } public function image() { return $this->fetch(); } public function video() { return $this->fetch(); } public function voice() { return $this->fetch(); } public function music() { return $this->fetch(); } }