News.php 1.0 KB

123456789101112131415161718192021222324252627282930
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | A3Mall
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2020 http://www.a3-mall.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Author: xzncit <158373108@qq.com>
  8. // +----------------------------------------------------------------------
  9. namespace app\api\service\wechat;
  10. use app\api\service\Service;
  11. use app\common\models\wechat\WechatNewsArticle as WechatNewsArticleModel;
  12. class News extends Service {
  13. /**
  14. * 新闻详情
  15. * @param $id
  16. * @return array
  17. * @throws \think\db\exception\DataNotFoundException
  18. * @throws \think\db\exception\DbException
  19. * @throws \think\db\exception\ModelNotFoundException
  20. */
  21. public static function detail($id){
  22. WechatNewsArticleModel::where(["id"=>$id])->inc("visit")->update();
  23. $data = WechatNewsArticleModel::where([ "id"=>$id ])->find();
  24. return [ "data"=>$data ];
  25. }
  26. }