小bug调整

This commit is contained in:
wangjinlei
2025-05-08 18:42:31 +08:00
parent 57fb655efc
commit 358c085e1e
2 changed files with 42 additions and 9 deletions

View File

@@ -1476,6 +1476,46 @@ class Article extends Controller
return json(['code' => 0, 'msg' => 'success', 'data' => ['nowtopic' => $now_list, 'topics' => $frag]]);
}
public function getTopicByIssn(){
$data = $this->request->post();
$rule = new Validate([
"issn"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$journal = $this->journal_obj->where("issn",$data['issn'])->find();
$topic_res = $this->journal_topic_obj->where('journal_id', $journal['journal_id'])->where('state', 0)->select();
$frag = [];
foreach ($topic_res as $v) {
if ($v['is_final'] == 1) {
$frag[] = $v;
}
}
foreach ($frag as $k => $val) {
$frag[$k]['tname'] = $this->getTname($val, $topic_res);
}
$re['list']=$frag;
return jsonSuccess($re);
}
public function getArticlesForSubmission(){
$data = $this->request->post();
$rule = new Validate([
"ids"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$res = $this->article_obj
->field("j_article.*,j_journal.title journal_title")
->join("j_journal","j_journal.journal_id = j_article.journal_id","left")
->whereIn("j_article.article_id",json_decode($data['ids']))->select();
$re['list'] = $res;
return jsonSuccess($re);
}
private function getTname($now, $arr)
{
if ($now['parent_id'] == 0) {