This commit is contained in:
wangjinlei
2023-06-27 15:50:14 +08:00
parent f3c66fcd41
commit e4c4096f5b
3 changed files with 76 additions and 36 deletions

View File

@@ -107,19 +107,30 @@ class Article extends Base
}
/**
* 获取proof的详情
* 获取预接收文章详情
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
// public function getProofDetail(){
// $data = $this->request->post();
// $rule = new Validate([]);
// if(!$rule->check($data)){
// return jsonError($rule->getError());
// }
// }
public function getPreacceptArticleDetail(){
$data = $this->request->post();
$rule = new Validate([
"article_id"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
$production_info = $this->production_article_obj->where("article_id",$article_info['article_id'])->where("state",0)->find();
if(!$production_info){
return jsonSuccess("production error");
}
$refers = $this->production_article_refer_obj->where('p_article_id',$production_info['p_article_id'])->where('state',0)->select();
$re['production'] = $production_info;
$re['refers'] = $refers;
return jsonSuccess($re);
}
/**
* @title 获取文章列表(编辑)
@@ -199,7 +210,7 @@ class Article extends Base
->field("t_article_reviewer.*,t_article_reviewer_question.rated")
->join("t_article_reviewer_question","t_article_reviewer_question.art_rev_id = t_article_reviewer.art_rev_id",'left')
->where("t_article_reviewer.article_id", $val['article_id'])
->where("t_article_reviewer.state", 'in', [0,1, 2, 3])
->where("t_article_reviewer.state", 'in', [0, 1, 2, 3])
->select();
$res[$key]['review'] = $cache_review;
@@ -1220,26 +1231,26 @@ class Article extends Base
// }
if ($data['state'] == 6) { //进入终审,通知主编邮件
$chiefs = $this->chief_to_journal_obj->join('t_user', 't_user.user_id = t_chief_to_journal.user_id', 'left')->where('t_chief_to_journal.journal_id', $journal_info['journal_id'])->where('t_chief_to_journal.state', 0)->select();
foreach ($chiefs as $v) {
$tts = 'Dear Dr. ' . ($v['realname'] == '' ? $v['account'] : $v['realname']) . ',<br><br>';
$tts .= 'The manuscript entitled “' . $article_info['title'] . '” has been peer-reviewed, revised and about to be published in ' . $journal_info['title'] . '.<br><br>';
$tts .= 'If you want to review this article, you could use it Submission System (<a href="https://submission.tmrjournals.com">Plese click here</a>).<br>';
$tts .= 'Your username: ' . $v['account'] . '<br>';
$tts .= 'Password: 123456qwe (Original password)<br><br>';
$tts .= 'If you are unable to review it now, you may provide your comments at a later time at your convenience. Then ,there is no need to reply to this email.<br><br>';
$tts .= 'Any comments you make will be valued by the editorial board. Please bring into our knowledge if there is any potential Conflict of Interest.<br><br><br><br>';
$tts .= 'Sincerely,<br>Editorial Office<br>' . $journal_info['title'] . '<br>';
$tts .= 'Email: ' . $journal_info['email'] . '<br>';
$tts .= 'Website:<a href="' . $journal_info['website'] . '">' . $journal_info['website'] . '</a>';
$sendUser['user_id'] = $v['user_id'];
$sendUser['email'] = $v['email'];
$sendUser['content'] = $tts;
// Queue::push('app\api\job\domail@fire',$sendUser,'domail');
sendEmail($v['email'], $journal_info['title'], $journal_info['title'], $tts, $journal_info['email'], $journal_info['epassword']);
}
}
// if ($data['state'] == 6) { //进入终审,通知主编邮件
// $chiefs = $this->chief_to_journal_obj->join('t_user', 't_user.user_id = t_chief_to_journal.user_id', 'left')->where('t_chief_to_journal.journal_id', $journal_info['journal_id'])->where('t_chief_to_journal.state', 0)->select();
// foreach ($chiefs as $v) {
// $tts = 'Dear Dr. ' . ($v['realname'] == '' ? $v['account'] : $v['realname']) . ',<br><br>';
// $tts .= 'The manuscript entitled “' . $article_info['title'] . '” has been peer-reviewed, revised and about to be published in ' . $journal_info['title'] . '.<br><br>';
// $tts .= 'If you want to review this article, you could use it Submission System (<a href="https://submission.tmrjournals.com">Plese click here</a>).<br>';
// $tts .= 'Your username: ' . $v['account'] . '<br>';
// $tts .= 'Password: 123456qwe (Original password)<br><br>';
// $tts .= 'If you are unable to review it now, you may provide your comments at a later time at your convenience. Then ,there is no need to reply to this email.<br><br>';
// $tts .= 'Any comments you make will be valued by the editorial board. Please bring into our knowledge if there is any potential Conflict of Interest.<br><br><br><br>';
// $tts .= 'Sincerely,<br>Editorial Office<br>' . $journal_info['title'] . '<br>';
// $tts .= 'Email: ' . $journal_info['email'] . '<br>';
// $tts .= 'Website:<a href="' . $journal_info['website'] . '">' . $journal_info['website'] . '</a>';
// $sendUser['user_id'] = $v['user_id'];
// $sendUser['email'] = $v['email'];
// $sendUser['content'] = $tts;
// // Queue::push('app\api\job\domail@fire',$sendUser,'domail');
// sendEmail($v['email'], $journal_info['title'], $journal_info['title'], $tts, $journal_info['email'], $journal_info['epassword']);
// }
// }
//转投操作
if ($data['trsjournal'] != 0) {
@@ -2546,7 +2557,7 @@ class Article extends Base
if ($uri == null) { //添加审稿人信息
$insert_reviewer_info['reviewer_id'] = $reviewer_info['user_id'];
$insert_reviewer_info['major'] = $reivewe['major'];
$insert_reviewer_info['cmajor'] = $reivewe['cmajor'];
// $insert_reviewer_info['cmajor'] = $reivewe['cmajor'];
$insert_reviewer_info['country'] = $reivewe['country'];
$res2 = $this->user_reviewer_info_obj->insert($insert_reviewer_info);
}

View File

@@ -211,6 +211,14 @@ class Promotion extends Base
$insert['frequency'] = $data['frequency'];
$insert['is_end'] = 1;
$insert['ctime'] = time();
//定义开始发送的页码
if(isset($data['beginPage'])&&$data['beginPage']!=1){
$f = [];
for ($i=1;$i<$data['beginPage'];$i++){
$f[] = $i;
}
$insert['pushed'] = json_encode($f);
}
$this->promotion_obj->insert($insert);
return jsonSuccess([]);
}
@@ -363,7 +371,7 @@ class Promotion extends Base
public function mytest()
{
$this->autoPushPromotion(6);
$this->autoPushPromotion(49);
}
public function mytest1()
@@ -390,13 +398,21 @@ class Promotion extends Base
// $l['email'] = "751475802@qq.com";
// $l['name'] = "wangjinlei";
// $l['type'] = "ash";
// $l['major'] = 75;
// $l['id'] = 35;
// $l1['email'] = "2714044218@qq.com";
// $l1['name'] = "liuna";
// $l1['type'] = "ash";
// $l1['major'] = 76;
// $l1['id'] = 36;
// $l2['email'] = "crc@tmrjournals.com";
// $l2['name'] = "xinyv";
// $l2['type'] = "ash";
// $l2['major'] = 77;
// $l2['id'] = 35;
// $list[] = $l;
// $list[] = $l1;
// $list[] = $l2;
//组合模版
$template = $pro_info['template'];
@@ -414,7 +430,7 @@ class Promotion extends Base
//发送邮件
foreach ($list as $v) {
$template1 = $template;
$template1 = str_replace("{{user_major}}", $this->getMajorOne($v['major']), $template1);
$template1 = str_replace("{{user_major}}",strtolower($this->getMajorOne($v['major'])) , $template1);
$template1 = str_replace("{{user_name}}", $v['name'], $template1);
$template1 = str_replace("{{unsubscribe}}", "https://submission.tmrjournals.com/api/Promotion/NoEmail?lib=" . $v['type'] . "&id=" . $v['id'], $template1);
$email_title = $pro_info['email_title'];

View File

@@ -709,6 +709,18 @@ class User extends Base
return jsonSuccess($re);
}
public function delAshUser(){
$data = $this->request->post();
$rule = new Validate([
"ash_id"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$this->user_ash_obj->where("ash_id",$data['ash_id'])->update(['state'=>1]);
return jsonSuccess([]);
}
public function upImportFile(){
$file = request()->file('userFile');
@@ -2514,6 +2526,7 @@ class User extends Base
*/
public function getMajorList()
{
die("service stop!!");
$res = $this->reviewer_major_obj->select();
return json(['code' => 0, 'data' => $res]);
}