接口修改
This commit is contained in:
@@ -45,7 +45,7 @@ class Workbench extends Base
|
|||||||
//标题
|
//标题
|
||||||
$sTitle = empty($aParam['title']) ? '': $aParam['title'];
|
$sTitle = empty($aParam['title']) ? '': $aParam['title'];
|
||||||
if(!empty($sTitle)){
|
if(!empty($sTitle)){
|
||||||
$aWhere = ['title' => trim($sTitle)];
|
$aWhere = ['title' => ['like','%'.trim($sTitle).'%']];
|
||||||
}
|
}
|
||||||
//国家
|
//国家
|
||||||
$sCountry = -1;
|
$sCountry = -1;
|
||||||
@@ -400,4 +400,67 @@ class Workbench extends Base
|
|||||||
Db::commit();
|
Db::commit();
|
||||||
return json_encode(['status' => 1,'msg' => 'Update successful']);
|
return json_encode(['status' => 1,'msg' => 'Update successful']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取审稿记录详情
|
||||||
|
*/
|
||||||
|
public function getArticleReviewDetail(){
|
||||||
|
//获取参数
|
||||||
|
$aParam = empty($aParam) ? $this->request->post() : $aParam;
|
||||||
|
//获取文章ID
|
||||||
|
$iArticleId = empty($aParam['article_id']) ? 0 : $aParam['article_id'];
|
||||||
|
if(empty($iArticleId)){
|
||||||
|
return json_encode(['status' => 2,'msg' => 'Please select the article']);
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取审稿记录ID
|
||||||
|
$iArtRevId = empty($aParam['art_rev_id']) ? 0 : $aParam['art_rev_id'];
|
||||||
|
if(empty($iArtRevId)){
|
||||||
|
return json_encode(['status' => 2,'msg' => 'Please select a record']);
|
||||||
|
}
|
||||||
|
//获取复审记录ID
|
||||||
|
$iArtRevRepId = empty($aParam['art_rev_rep_id']) ? 0 : $aParam['art_rev_rep_id'];
|
||||||
|
if(empty($iArtRevId) && empty($iArtRevRepId)){
|
||||||
|
return json_encode(['status' => 2,'msg' => 'Please select a record']);
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询文章
|
||||||
|
$aArticle = json_decode($this->get($aParam),true);
|
||||||
|
$iStatus = empty($aArticle['status']) ? 0 : $aArticle['status'];
|
||||||
|
if($iStatus != 1){
|
||||||
|
return json_encode($aArticle);
|
||||||
|
}
|
||||||
|
$aArticle = empty($aArticle['data']) ? [] : $aArticle['data'];
|
||||||
|
|
||||||
|
//查询审稿记录
|
||||||
|
$aWhere = ['art_rev_id' => $iArtRevId,'article_id' => $iArticleId];
|
||||||
|
$aArticleReviewer = Db::name('article_reviewer')->field('art_rev_id,reviewer_id,ctime')->where($aWhere)->find();
|
||||||
|
if(empty($aArticleReviewer)){
|
||||||
|
return json_encode(['status' => 3,'msg' => 'Review record does not exist']);
|
||||||
|
}
|
||||||
|
if(empty($iArtRevRepId)){
|
||||||
|
//查询初审问卷
|
||||||
|
$aWhere = ['art_rev_id' => $iArtRevId];
|
||||||
|
$aQuestion = Db::name('article_reviewer_question')->field('is_anonymous')->where($aWhere)->find();
|
||||||
|
$aArticleReviewer['is_anonymous'] = empty($aQuestion['is_anonymous']) ? 0 : $aQuestion['is_anonymous'];
|
||||||
|
}
|
||||||
|
//查询审稿人姓名
|
||||||
|
$iUserId = empty($aArticleReviewer['reviewer_id']) ? 0 : $aArticleReviewer['reviewer_id'];
|
||||||
|
if(!empty($iUserId)){
|
||||||
|
$aWhere = ['user_id' => $iUserId,'state' => 0];
|
||||||
|
$aUser = Db::name('user')->field('realname,email')->where($aWhere)->find();
|
||||||
|
$aArticleReviewer['realname'] = empty($aUser['realname']) ? '' : $aUser['realname'];
|
||||||
|
$aArticleReviewer['email'] = empty($aUser['email']) ? '' : $aUser['email'];
|
||||||
|
}
|
||||||
|
|
||||||
|
//组装信息
|
||||||
|
$aData = ['article' => $aArticle,'article_reviewer' => $aArticleReviewer];
|
||||||
|
//查询复审信息
|
||||||
|
if(!empty($iArtRevRepId)){
|
||||||
|
//查询初审问卷
|
||||||
|
$aWhere = ['art_rev_id' => $iArtRevId,'art_rev_rep_id' => $iArtRevRepId];
|
||||||
|
$aData['article_reviewer_repeat'] = Db::name('article_reviewer_repeat')->where($aWhere)->find();
|
||||||
|
}
|
||||||
|
return json_encode(['status' => 1,'msg' => 'success','data' => $aData]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user