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

@@ -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");
}
//更改各种状态