1
This commit is contained in:
@@ -4,6 +4,7 @@ namespace app\api\controller;
|
||||
|
||||
use app\api\controller\Base;
|
||||
use think\Validate;
|
||||
use think\Queue;
|
||||
|
||||
|
||||
class Ucenter extends Base{
|
||||
@@ -122,7 +123,7 @@ class Ucenter extends Base{
|
||||
}
|
||||
// $ids = $this->reviewer_to_journal_obj->where('reviewer_id',$data['user_id'])->where('state',0)->where('is_yboard',0)->column('journal_id');
|
||||
$ids = $this->user_to_yboard_obj->where('user_id',$data['user_id'])->where('start_date','<=',time())->where('end_date',">=",time())->where('state',0)->column("journal_id");
|
||||
$journals = $this->journal_obj->where('journal_id','in',$ids)->where('state',0)->select();
|
||||
$journals = $this->journal_obj->where('journal_id','not in',$ids)->where('state',0)->select();
|
||||
$re['journals'] = $journals;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
@@ -143,7 +144,46 @@ class Ucenter extends Base{
|
||||
$insert['user_id'] = $data['user_id'];
|
||||
$insert['journal_id'] = $data['journal_id'];
|
||||
$insert['ctime'] = time();
|
||||
$this->apply_yboard_obj->insert($insert);
|
||||
$id = $this->apply_yboard_obj->insertGetId($insert);
|
||||
$journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
|
||||
$user_info = $this->user_obj->where('user_id',$data['user_id'])->find();
|
||||
$editor_info = $this->user_obj->where('user_id',$journal_info['editor_id'])->find();
|
||||
//发送邮件给用户
|
||||
$dd = "Dear Dr. ".$user_info['realname'].",<br/><br/>";
|
||||
$dd .= "We are writing to inform you that the Editorial Office has received your application for the position of Young Scientist Board Member of <i>".$journal_info['title']."</i> journal. Your application is currently under review and has been assigned the application number TMR-".$journal_info['abbr']."-".$id.".<br/><br/>";
|
||||
$dd .= "We would like to take this opportunity to briefly introduce you to the rights and obligations of a Youth Scientist Board Member.<br/><br/>";
|
||||
$dd .= "Rights:<br/><br/>";
|
||||
$dd .= "1. Electronic Certificate: As a Young Scientist Board Member, you will receive an electronic certificate to acknowledge your position in our publication.<br/>";
|
||||
$dd .= "2. Opportunity for Advancement: Outstanding Young Scientist Board Member may be considered as potential candidates for the Editorial Board.<br/>";
|
||||
$dd .= "3. Special Issues: You will have the opportunity to apply for a special Issue to expand your influence and that of your team.<br/><br/>";
|
||||
$dd .= "Obligations:<br/><br/>";
|
||||
$dd .= "1. Peer Review: As a Young Scientist Board Member, you will be required to review and assess 3-5 manuscripts per year, based on your area of research.<br/>";
|
||||
$dd .= "2. Active Promotion: You should actively promote our publication in your academic and professional circles and recommend quality manuscripts to scholars in your network.<br/>";
|
||||
$dd .= "3. Provide Feedback: You should provide constructive feedback and suggestions to improve the direction and style of our publication. If feasible, you may also attend small forums or conferences to represent our publication.<br/><br/>";
|
||||
$dd .= "We appreciate your interest in becoming a Young Scientist Board Member and we will inform you of the outcome of your application as soon as possible. If you have any questions or concerns, please do not hesitate to contact us.<br/><br/><br/>";
|
||||
$dd .= 'Sincerely,<br>Editorial Office<br>';
|
||||
$dd .= $journal_info['title'] . '<br>';
|
||||
$dd .= 'Email: ' . $journal_info['email'] . '<br>';
|
||||
$dd .= 'Website: ' . $journal_info['website'] . '<br>';
|
||||
|
||||
$maidata['email'] = $user_info['email'];
|
||||
$maidata['title'] = $journal_info['title'];
|
||||
$maidata['content'] = $dd;
|
||||
$maidata['tmail'] = $journal_info['email'];
|
||||
$maidata['tpassword'] = $journal_info['epassword'];
|
||||
Queue::push('app\api\job\mail@fire', $maidata, "tmail");
|
||||
|
||||
//发送邮件给编辑
|
||||
$vv = "Dear editor,<br/><br/>";
|
||||
$vv .= "Please check the new application for Young Scientist Board Member for ".$journal_info['title']." Journal.";
|
||||
$mai['email'] = $editor_info['email'];
|
||||
$mai['title'] = $journal_info['title'];
|
||||
$mai['content'] = $vv;
|
||||
$mai['tmail'] = $journal_info['email'];
|
||||
$mai['tpassword'] = $journal_info['epassword'];
|
||||
Queue::push('app\api\job\mail@fire', $mai, "tmail");
|
||||
|
||||
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
@@ -155,6 +195,13 @@ class Ucenter extends Base{
|
||||
$journal = $this->journal_obj->where('journal_id',$v['journal_id'])->find();
|
||||
$cl = $this->user_to_yboard_obj->where('user_id',$user_id)->where('journal_id',$v['journal_id'])->select();
|
||||
$journal['sd'] = $cl;
|
||||
$journal['article_num'] = $this->article_obj->where('user_id',$user_id)->where('state',5)->where('journal_id',$v['journal_id'])->count();
|
||||
$journal['reviewer_num'] = $this->article_reviewer_obj
|
||||
->join("t_article","t_article.article_id = t_article_reviewer.article_id","left")
|
||||
->where('t_article_reviewer.reviewer_id',$user_id)
|
||||
->where('t_article.journal_id',$v['journal_id'])
|
||||
->where('t_article_reviewer.state','in',[1,2,3])
|
||||
->count();
|
||||
$frag[] = $journal;
|
||||
}
|
||||
return $frag;
|
||||
|
||||
Reference in New Issue
Block a user