This commit is contained in:
wangjinlei
2022-01-27 18:15:35 +08:00
parent fb0114d85a
commit 4ce4deb4aa
3 changed files with 40 additions and 11 deletions

View File

@@ -168,12 +168,40 @@ class Article extends Controller {
$res_key = $this->article_obj->where($wstr)->limit(5 - count($res_rel))->select();
}
$res = array_merge($res_key,$res_rel);
$res = array_merge($res_rel, $res_key);
$frag = [];
foreach ($res as $k => $v) {
$res[$k]['journal'] = $this->journal_obj->where('journal_id', $v['journal_id'])->find();
$res[$k]['stage'] = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find();
$frag[$v['article_id']] = $v;
$frag[$v['article_id']]['journal'] = $this->journal_obj->where('journal_id', $v['journal_id'])->find();
$frag[$v['article_id']]['stage'] = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find();
if ($frag[$v['article_id']]['stage']['stage_year'] == (date('Y') - 1)) {
$frag[$v['article_id']]['ysort'] = 1;
} else if ($frag[$v['article_id']]['stage']['stage_year'] == (date('Y') - 2)) {
$frag[$v['article_id']]['ysort'] = 2;
} else if ($frag[$v['article_id']]['stage']['stage_year'] == date('Y')) {
$frag[$v['article_id']]['ysort'] = 3;
} else {
$frag[$v['article_id']]['ysort'] = 4;
}
return jsonSuccess($res);
}
$f = [];
foreach ($frag as $v){
$f[] = $v;
}
for ($i = 0; $i < count($f); $i++) {
for ($j = $i + 1; $j < count($f); $j++) {
if ($f[$i]['ysort'] > $f[$j]['ysort']) {
$tmp = $f[$j];
$f[$j] = $f[$i];
$f[$i] = $tmp;
}
}
}
return jsonSuccess($f);
}
private function sys_author($authors, $organs, $atto) {

View File

@@ -1066,6 +1066,7 @@ class Journal extends Controller {
$insert['journal_id'] = $data['journal_id'];
$insert['email'] = $data['email'];
$id = $this->subscribe_journal_obj->insertGetId($insert);
$journal_info = $this->journal_obj->where("journal_id",$data['journal_id'])->find();
//发送邮件感谢
$tt = 'Dear Researcher,<br><br>';
$tt .= 'Welcome you to the email alert for the latest research and more. Thank you for your interest in our publications and topics.<br>';
@@ -1075,7 +1076,7 @@ class Journal extends Controller {
$tt .= 'Email: publisher@tmrjournals.com';
$tt .= 'www.tmrjournals.com';
$maidata['email'] = $data['email'];
$maidata['title'] = 'Traditional Medicine Research ISSN 2413-3973';
$maidata['title'] = $journal_info['title']." ISSN ".$journal_info['issn'];//'Traditional Medicine Research ISSN 2413-3973';
$maidata['content'] = $tt;
$maidata['tmail'] = 'publicrelations@tmrjournals.com';
$maidata['tpassword'] = 'pRWU999999';
@@ -1118,7 +1119,7 @@ class Journal extends Controller {
$tt .= 'Email: publisher@tmrjournals.com';
$tt .= 'www.tmrjournals.com';
$maidata['email'] = $data['email'];
$maidata['title'] = 'Traditional Medicine Research ISSN 2413-3973';
$maidata['title'] = $journal_info['title']." ISSN ".$journal_info['issn'];//'Traditional Medicine Research ISSN 2413-3973';
$maidata['content'] = $tt;
$maidata['tmail'] = 'publicrelations@tmrjournals.com';
$maidata['tpassword'] = 'pRWU999999';

View File

@@ -220,7 +220,7 @@ class Datebase extends Controller{
*/
public function dataPush(){
$data = $this->request->post();
// $data["journal_stage_id"] = 294;
// $data["journal_stage_id"] = 305;
$stage_info = $this->journal_stage_obj->where("journal_stage_id",$data["journal_stage_id"])->find();
$this->createEmailFile($data["journal_stage_id"]);
$journal_info = $this->journal_obj->where("journal_id",$stage_info["journal_id"])->find();