// +---------------------------------------------------------------------- namespace app\api\service\wechat; use app\api\service\Service; use app\common\models\wechat\WechatNewsArticle as WechatNewsArticleModel; class News extends Service { /** * 新闻详情 * @param $id * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public static function detail($id){ WechatNewsArticleModel::where(["id"=>$id])->inc("visit")->update(); $data = WechatNewsArticleModel::where([ "id"=>$id ])->find(); return [ "data"=>$data ]; } }