From 72f58ae072643572aef4459ed8471a8680c7c49b Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Fri, 19 May 2023 14:15:32 +0800 Subject: [PATCH] 1 --- application/api/controller/Article.php | 55 ++++++++++++++++++------ application/api/controller/Journal.php | 6 ++- application/api/controller/Promotion.php | 36 ++++++++++------ 3 files changed, 68 insertions(+), 29 deletions(-) diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index 11b3eb6..c4e451f 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -2307,6 +2307,47 @@ class Article extends Base $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; $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']); - $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; @@ -2874,7 +2904,6 @@ class Article extends Base $pushData['content'] = $all; $pushData['user_id'] = $value['reviewer_id']; $pushData['email'] = $value['email']; - // Queue::push('app\api\job\domail@fire',$pushData,'domail'); $num = $value['recommend']; if ($value['comments'] != '') { $difference .= "
Reviewer " . ($k + 1) . ' : ' . $recommend[$num] . " ( " . preg_replace("/\t/", "", $value['comments']) . " )
"; @@ -2889,10 +2918,8 @@ class Article extends Base $pushData['user_id'] = $value['reviewer_id']; $pushData['email'] = $value['email']; 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)) { - // Queue::push('app\api\job\domail@fire',$pushData,'domail'); } } } diff --git a/application/api/controller/Journal.php b/application/api/controller/Journal.php index 42b21fb..b56ecbc 100644 --- a/application/api/controller/Journal.php +++ b/application/api/controller/Journal.php @@ -119,7 +119,9 @@ class Journal extends Base { 'journal_id'=>'require', 'level'=>'require', 'email'=>'require', - 'epassword'=>'require' + 'epassword'=>'require', + "kfen"=>"require", + "scope"=>"require" ]); if(!$rule->check($data)){ return jsonError($rule->getError()); @@ -127,6 +129,8 @@ class Journal extends Base { $update['level'] = $data['level']; $update['email'] = $data['email']; $update['epassword'] = $data['epassword']; + $update['kfen'] = $data['kfen']; + $update['scope'] = trim($data['scope']); $this->journal_obj->where('journal_id',$data['journal_id'])->update($update); return jsonSuccess([]); } diff --git a/application/api/controller/Promotion.php b/application/api/controller/Promotion.php index 60915c7..2db5de5 100644 --- a/application/api/controller/Promotion.php +++ b/application/api/controller/Promotion.php @@ -26,7 +26,7 @@ class Promotion extends Base if(!$rule->check($data)){ 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){ $list[$k]['journal'] = $this->journal_obj->where('journal_id',$v['journal_id'])->find(); if($v['category']=="major"){ @@ -35,6 +35,9 @@ class Promotion extends Base $list[$k]['major_str'] = ''; } $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; return jsonSuccess($re); @@ -305,7 +308,11 @@ class Promotion extends Base } 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']); $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']); - $l['email'] = "751475802@qq.com"; - $l['name'] = "wangjinlei"; - $l['type'] = "ash"; - $l['id'] = 35; - $l1['email'] = "2714044218@qq.com"; - $l1['name'] = "liuna"; - $l1['type'] = "ash"; - $l1['id'] = 36; - $list[] = $l; - $list[] = $l1; + $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['name'] = "wangjinlei"; +// $l['type'] = "ash"; +// $l['id'] = 35; +// $l1['email'] = "2714044218@qq.com"; +// $l1['name'] = "liuna"; +// $l1['type'] = "ash"; +// $l1['id'] = 36; +// $list[] = $l; +// $list[] = $l1; + //组合模版 $template = $pro_info['template']; $template = str_replace("{{journal_title}}",$journal_info['title'],$template); @@ -349,7 +357,7 @@ class Promotion extends Base $ali['content'] = $template; $ali['has_hb'] = $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"); } //更改各种状态