This commit is contained in:
wangjinlei
2023-07-03 13:14:56 +08:00
parent b251027249
commit bfa6734af4
4 changed files with 91 additions and 2 deletions

View File

@@ -110,6 +110,46 @@ class Auto extends Base
Queue::push('app\api\job\mail@fire', $maidata, "tmail");
}
public function mypushemail(){
die("service stop");
$data = $this->request->post();
$rule = new Validate([
"num"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$list = $this->user_author_obj
->field("t_user.*")
->join("t_user","t_user.user_id = t_user_author.user_id","left")
->where('t_user_author.journal_title',"Traditional Medicine Research")
->where('t_user_author.stage_year',">","2021")
->page($data['num'],1000)
->select();
// $journal_info = $this->journal_obj->where('journal_id',1)->find();
// $l['email'] = "751475802@qq.com";
// $l['realname'] = "wangjinlei";
// $l1['email'] = "2714044218@qq.com";
// $l1['realname'] = "liuna";
// $list[] = $l;
// $list[] = $l1;
// return jsonSuccess($list);
foreach ($list as $v){
$tt = 'Dear Dr. ' . ($v['realname'] == '' ? $v['account'] : $v['realname']) . ',<br/><br/>';
$tt .= "Congratulations! Our Traditional Medicine Research Journal has achieved its first impact factor of 1.3. Thank you for your valuable contribution. We would like to express our sincere appreciation for your valuable contributions and for choosing our journal as a platform for sharing your groundbreaking research.<br/>Looking forward to your continued contributions in the future.<br/><br/>";
$tt .= "Sincerely,<br/>Editorial Office<br/>Traditional Medicine Research<br/>Email: tmr@tmrjournals.com<br/>Website:https://www.tmrjournals.com/tmr";
$ali['email'] = $v['email'];
$ali['title'] = "Traditional Medicine Research Achieves its First Impact Factor of 1.3";
$ali['content'] = $tt;
$ali['has_hb'] = 1;
// sendEmail($v['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
Queue::push('app\api\job\mail@promotion', $ali, "tmail");
}
}
// public function cvComit(){
// $list = $this->user_reviewer_info_obj

View File

@@ -114,7 +114,7 @@ class Preaccept extends Base
}
$p_info = $this->production_article_obj->where('article_id',$data['article_id'])->where('state',0)->find();
$pre_refer = $this->production_article_refer_obj->where('p_refer_id',$data['pre_p_refer_id'])->find();
$insert['p_article_id'] = $data['p_article_id'];
$insert['p_article_id'] = $p_info['p_article_id'];
$insert['index'] = $pre_refer['index']+1;
$insert['author'] = trim($data['author']);
$insert['title'] = trim($data['title']);
@@ -129,6 +129,29 @@ class Preaccept extends Base
return jsonSuccess([]);
}
public function editReferNotdoi(){
$data = $this->request->post();
$rule = new Validate([
"p_refer_id"=>"require",
"author"=>"require",
"title"=>"require",
"joura"=>"require",
"dateno"=>"require",
"doilink"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$update['author'] = trim($data['author']);
$update['title'] = trim($data['title']);
$update['joura'] = trim($data['joura']);
$update['dateno'] = trim($data['dateno']);
$update['doilink'] = trim($data['doilink']);
$update['refer_doi'] = trim($data['doilink']);
$this->production_article_refer_obj->where('p_refer_id',$data['p_refer_id'])->update($update);
return jsonSuccess([]);
}
// public function aaa(){
// $list = $this->production_article_refer_obj->where('p_article_id',423)->where('state',0)->where('index',">",0)->setInc('index');
// dump($list);

View File

@@ -596,7 +596,7 @@ class Production extends Base
if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$list = $this->production_article_refer_obj->where('p_article_id', $data['p_article_id'])->where('state', 0)->select();
$list = $this->production_article_refer_obj->where('p_article_id', $data['p_article_id'])->where('state', 0)->order("index")->select();
$re['refers'] = $list;
return jsonSuccess($re);
}

View File

@@ -52,5 +52,31 @@ class Web extends Base
$re['articles'] = $list;
return jsonSuccess($re);
}
public function getRefers(){
$data = $this->request->post();
$rule = new Validate([
"w_article_id"=>"require",
"doi"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$production_info = $this->production_article_obj->where('w_article_id',$data['w_article_id'])->find();
if (!$production_info){//一次验证如果w_article_id获取失败
$production_info = $this->production_article_obj->where('doi',$data['doi'])->where('state',0)->find();
}
if(!$production_info){//如果两次获取都失败
$refers = [];
return jsonSuccess(['refer'=>$refers]);
}
$list = $this->production_article_refer_obj->where('p_article_id',$production_info['p_article_id'])->where('state',0)->order('index')->select();
$re['refers'] = $list;
return jsonSuccess($re);
}
}
?>