This commit is contained in:
wangjinlei
2022-08-23 15:20:37 +08:00
parent 6c759de0fb
commit 29c6b4c627
6 changed files with 200 additions and 31 deletions

View File

@@ -215,6 +215,23 @@ class Article extends Controller {
return json(['total' => $count, 'data' => $res]);
}
/**
* 获取文章的用户详情
*/
public function getArticleUserDetail(){
$data = $this->request->post();
$rule = new Validate([
'article_id'=>'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
$user_info = $this->user_obj->where('user_id',$article_info['user_id'])->find();
$re['userDetail'] = $user_info;
return jsonSuccess($re);
}
/**
* @title 获取文章详情(作者,编辑)