This commit is contained in:
wangjinlei
2023-05-19 14:15:32 +08:00
parent d5a2822951
commit 72f58ae072
3 changed files with 68 additions and 29 deletions

View File

@@ -2307,6 +2307,47 @@ class Article extends Base
$fen += $b_fen; $fen += $b_fen;
//图表扣分环节
if($article_info['journal_id']==1){
$jan_fen = 0;
if($article_info['type']=="A"){
if($all_num<1){
$jan_fen = 2;
}elseif ($all_num<2){
$jan_fen = 1;
}elseif ($all_num<3){
$jan_fen = 0.5;
}
}elseif ($article_info['type']=="B"){
if($all_num==0){
$jan_fen = 1;
}
}
$b_fen = $b_fen-$jan_fen;
$fen = $fen - $jan_fen;
}else{
$jan_fen1 = 0;
if($article_info['type']=="A"){
if($all_num<1){
$jan_fen1 = 1;
}if($all_num<2){
$jan_fen1 = 0.5;
}
}elseif ($article_info['type']=="B"){
if($all_num==0){
$jan_fen1 = 0.5;
}
}
$b_fen = $b_fen-$jan_fen1;
$fen = $fen - $jan_fen1;
}
//国家 //国家
$c_fen = 0; $c_fen = 0;
$author = $this->article_author_obj->where('article_id', $article_id)->where('is_report', 1)->find(); $author = $this->article_author_obj->where('article_id', $article_id)->where('is_report', 1)->find();
@@ -2540,17 +2581,6 @@ class Article extends Base
sendEmail($author_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']); sendEmail($author_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
$sendUser = [
'title' => $journal_info['title'], // 邮件标题
'content' => $tt, //邮件内容
'user_id' => $add_user_id, //收件人ID
'email' => $author_info['email'], // 收件人邮箱
'journal_id' => $journal_info['journal_id'], // 期刊ID
'sendEmail' => $journal_info['email'], // 期刊邮箱
'sendPassword' => $journal_info['epassword'], // 期刊密码
'from_name' => $journal_info['title']
];
// Queue::push('app\api\job\domail@fire',$sendUser,'domail');
//添加转换表数据 //添加转换表数据
$art_insert['art_aut_id'] = $art_aut_id; $art_insert['art_aut_id'] = $art_aut_id;
@@ -2874,7 +2904,6 @@ class Article extends Base
$pushData['content'] = $all; $pushData['content'] = $all;
$pushData['user_id'] = $value['reviewer_id']; $pushData['user_id'] = $value['reviewer_id'];
$pushData['email'] = $value['email']; $pushData['email'] = $value['email'];
// Queue::push('app\api\job\domail@fire',$pushData,'domail');
$num = $value['recommend']; $num = $value['recommend'];
if ($value['comments'] != '') { if ($value['comments'] != '') {
$difference .= "<br>Reviewer " . ($k + 1) . ' : ' . $recommend[$num] . " ( " . preg_replace("/\t/", "", $value['comments']) . " )<br>"; $difference .= "<br>Reviewer " . ($k + 1) . ' : ' . $recommend[$num] . " ( " . preg_replace("/\t/", "", $value['comments']) . " )<br>";
@@ -2889,10 +2918,8 @@ class Article extends Base
$pushData['user_id'] = $value['reviewer_id']; $pushData['user_id'] = $value['reviewer_id'];
$pushData['email'] = $value['email']; $pushData['email'] = $value['email'];
if ($state == 3 && ($value['recommend'] == 1 || $value['recommend'] == 2)) { if ($state == 3 && ($value['recommend'] == 1 || $value['recommend'] == 2)) {
// Queue::push('app\api\job\domail@fire',$pushData,'domail');
} }
if ($state == 5 && ($value['recommend'] == 3 || $value['recommend'] == 4)) { if ($state == 5 && ($value['recommend'] == 3 || $value['recommend'] == 4)) {
// Queue::push('app\api\job\domail@fire',$pushData,'domail');
} }
} }
} }

View File

@@ -119,7 +119,9 @@ class Journal extends Base {
'journal_id'=>'require', 'journal_id'=>'require',
'level'=>'require', 'level'=>'require',
'email'=>'require', 'email'=>'require',
'epassword'=>'require' 'epassword'=>'require',
"kfen"=>"require",
"scope"=>"require"
]); ]);
if(!$rule->check($data)){ if(!$rule->check($data)){
return jsonError($rule->getError()); return jsonError($rule->getError());
@@ -127,6 +129,8 @@ class Journal extends Base {
$update['level'] = $data['level']; $update['level'] = $data['level'];
$update['email'] = $data['email']; $update['email'] = $data['email'];
$update['epassword'] = $data['epassword']; $update['epassword'] = $data['epassword'];
$update['kfen'] = $data['kfen'];
$update['scope'] = trim($data['scope']);
$this->journal_obj->where('journal_id',$data['journal_id'])->update($update); $this->journal_obj->where('journal_id',$data['journal_id'])->update($update);
return jsonSuccess([]); return jsonSuccess([]);
} }

View File

@@ -26,7 +26,7 @@ class Promotion extends Base
if(!$rule->check($data)){ if(!$rule->check($data)){
return jsonError($rule->getError()); return jsonError($rule->getError());
} }
$list = $this->promotion_obj->where('user_id',$data['user_id'])->select(); $list = $this->promotion_obj->where('user_id',$data['user_id'])->where('state',0)->select();
foreach ($list as $k => $v){ foreach ($list as $k => $v){
$list[$k]['journal'] = $this->journal_obj->where('journal_id',$v['journal_id'])->find(); $list[$k]['journal'] = $this->journal_obj->where('journal_id',$v['journal_id'])->find();
if($v['category']=="major"){ if($v['category']=="major"){
@@ -35,6 +35,9 @@ class Promotion extends Base
$list[$k]['major_str'] = ''; $list[$k]['major_str'] = '';
} }
$list[$k]['user_count'] = $this->getLibUserCount($v['library'],$v['category'],$v['category']=="major"?$v['major']:$v['keyword']); $list[$k]['user_count'] = $this->getLibUserCount($v['library'],$v['category'],$v['category']=="major"?$v['major']:$v['keyword']);
$list[$k]['pushed_num'] =$v['pushed']==""?0:count(json_decode($v['pushed']))*$v['pagesize'];
} }
$re['list'] = $list; $re['list'] = $list;
return jsonSuccess($re); return jsonSuccess($re);
@@ -305,7 +308,11 @@ class Promotion extends Base
} }
public function mytest(){ public function mytest(){
$this->autoPushPromotion(1); $this->autoPushPromotion(6);
}
public function mytest1(){
aliemail("751475802@qq.com","test","testcontent");
} }
@@ -321,17 +328,18 @@ class Promotion extends Base
$push_arr = json_decode($pro_info['pushed']); $push_arr = json_decode($pro_info['pushed']);
$pageIndex = $pro_info['pushed']==""?1:end($push_arr)+1; $pageIndex = $pro_info['pushed']==""?1:end($push_arr)+1;
//选择人员 //选择人员
// $list = $this->getLibraryList($pro_info['library'],$pro_info['category'],$pro_info['category']=="major"?$pro_info['major']:$pro_info['keyword'],$pageIndex,$pro_info['pagesize']); $list = $this->getLibraryList($pro_info['library'],$pro_info['category'],$pro_info['category']=="major"?$pro_info['major']:$pro_info['keyword'],$pageIndex,$pro_info['pagesize']);
$l['email'] = "751475802@qq.com"; // $l['email'] = "751475802@qq.com";
$l['name'] = "wangjinlei"; // $l['name'] = "wangjinlei";
$l['type'] = "ash"; // $l['type'] = "ash";
$l['id'] = 35; // $l['id'] = 35;
$l1['email'] = "2714044218@qq.com"; // $l1['email'] = "2714044218@qq.com";
$l1['name'] = "liuna"; // $l1['name'] = "liuna";
$l1['type'] = "ash"; // $l1['type'] = "ash";
$l1['id'] = 36; // $l1['id'] = 36;
$list[] = $l; // $list[] = $l;
$list[] = $l1; // $list[] = $l1;
//组合模版 //组合模版
$template = $pro_info['template']; $template = $pro_info['template'];
$template = str_replace("{{journal_title}}",$journal_info['title'],$template); $template = str_replace("{{journal_title}}",$journal_info['title'],$template);
@@ -349,7 +357,7 @@ class Promotion extends Base
$ali['content'] = $template; $ali['content'] = $template;
$ali['has_hb'] = $pro_info['has_hb']; $ali['has_hb'] = $pro_info['has_hb'];
// aliemail($v['email'],$pro_info['email_title'],$template,$pro_info['has_hb']); // aliemail($v['email'],$pro_info['email_title'],$template,$pro_info['has_hb']);
Queue::push('app\api\job\mail@promotion',$ali,'mail'); Queue::push('app\api\job\mail@promotion', $ali, "tmail");
} }
//更改各种状态 //更改各种状态