123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <?php
- namespace app\wechat\controller\api;
- use app\wechat\service\MediaService;
- use library\Controller;
- use think\Db;
- class Review extends Controller
- {
-
- public function news($id = 0)
- {
- $this->news = MediaService::news(empty($id) ? input('id') : $id);
- $this->fetch();
- }
-
- 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')]);
- $this->info = Db::name('WechatNewsArticle')->where($where)->find();
- $this->fetch();
- }
-
- public function text()
- {
- $this->content = strip_tags(input('content', ''), '<a><img>');
- $this->fetch();
- }
-
- public function image()
- {
- $this->content = strip_tags(input('content', ''), '<a><img>');
- $this->fetch();
- }
-
- public function video()
- {
- $this->url = strip_tags(input('url', ''), '<a><img>');
- $this->title = strip_tags(input('title', ''), '<a><img>');
- $this->fetch();
- }
-
- public function voice()
- {
- $this->url = strip_tags(input('url', ''), '<a><img>');
- $this->fetch();
- }
-
- public function music()
- {
- $this->url = strip_tags(input('url', ''), '<a><img>');
- $this->desc = strip_tags(input('desc', ''), '<a><img>');
- $this->title = strip_tags(input('title', ''), '<a><img>');
- $this->fetch();
- }
- }
|