20201112
This commit is contained in:
@@ -282,8 +282,11 @@ class Main extends Controller {
|
||||
* @method POST
|
||||
*
|
||||
* @param name:type require:1 type:string desc:类型(cite/read/download)
|
||||
* @param name:pageIndex type:int require:1 desc:当前页码数
|
||||
* @param name:pageSize type:int require:1 desc:单页数据条数
|
||||
*
|
||||
* @return articles:文章信息array#
|
||||
* @return count:总数
|
||||
*/
|
||||
public function getThireTopArticles(){
|
||||
$data = $this->request->post();
|
||||
@@ -296,15 +299,21 @@ class Main extends Controller {
|
||||
}else{
|
||||
return jsonError('Please make sure type in "cite/read/download"');
|
||||
}
|
||||
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
|
||||
$list = $this->article_obj->field('j_article.*,j_journal_stage.*,j_journal.title journal_title,j_journal.jabbr journal_short')
|
||||
->join(array(['j_journal_stage', 'j_article.journal_stage_id = j_journal_stage.journal_stage_id', 'LEFT'],['j_journal','j_article.journal_id = j_journal.journal_id','LEFT']))
|
||||
->where('j_article.state', 0)
|
||||
->where('j_article.state', 0)
|
||||
->where('j_journal_stage.is_publish',1)
|
||||
// ->orderRaw('j_article.cited+j_article.abs_num+j_article.pdf_num desc')
|
||||
->order($order)
|
||||
->limit(20)
|
||||
->limit($limit_start,$data['pageSize'])
|
||||
->select();
|
||||
|
||||
$count = $this->article_obj
|
||||
->join(array(['j_journal_stage', 'j_article.journal_stage_id = j_journal_stage.journal_stage_id', 'LEFT'],['j_journal','j_article.journal_id = j_journal.journal_id','LEFT']))
|
||||
->where('j_article.state', 0)
|
||||
->where('j_journal_stage.is_publish',1)
|
||||
->count();
|
||||
//获取作者
|
||||
foreach ($list as $k => $v) {
|
||||
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find();
|
||||
@@ -325,7 +334,7 @@ class Main extends Controller {
|
||||
}
|
||||
$list[$k]['title'] = $cache_title;
|
||||
}
|
||||
return jsonSuccess(['articles' => $list]);
|
||||
return jsonSuccess(['articles' => $list,'count'=>$count]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user