token; $article = AgentArticle::field('id,title,content,file,type')->where(['root_id'=>$token['root_org'],'id' => $article_id, 'disable' => 0])->find(); if (empty($article)) { $article = [ 'title' => '该文章不存在', 'content' => '您访问的内容不存在', 'file' => '', 'type' => '' ]; return json(['code' => 0, 'msg' => '获取成功', 'data' => $article]); } // 添加足迹 if (!empty($token['uid']) && !$token['isEmployee']) { event(new FootPrints($token['uid'], $token['share_employee'] ?? 0, $token['share_org'] ?? 0, $article, 'agentArticle')); } $vrObj = new Vr(); $article['file_img'] = $article['files'] = ''; if($article['type']==3){ $article['files'] = !empty($article['file'][0]) ? str_replace('https://'.config('app.ali_oss_bindurl').'/','',$article['file'][0]) :''; $article['file_img'] = !empty($article['file'][0]) ? $vrObj->getFirstImg(str_replace('https://'.config('app.ali_oss_bindurl').'/','',$article['file'][0])) : ''; } return json(['code' => 0, 'msg' => '获取成功', 'data' => $article]); } }