20201112
This commit is contained in:
@@ -656,7 +656,22 @@ class Journal extends Controller {
|
||||
}
|
||||
$insert['journal_id'] = $data['journal_id'];
|
||||
$insert['email'] = $data['email'];
|
||||
$this->subscribe_journal_obj->insert($insert);
|
||||
$id = $this->subscribe_journal_obj->insertGetId($insert);
|
||||
//发送邮件感谢
|
||||
$tt = 'Dear Researcher,<br><br>';
|
||||
$tt .= 'Welcome you to the email alert for the latest research and more. Thank you for your interest in our publications and topics.<br>';
|
||||
$tt .= '<a href="http://journalapi.tmrjournals.com/public/index.php/api/Journal/UnsubscribeJournal/snum/'.$id.'">Unsubscribe</a><br>';
|
||||
$tt .= 'This service is provided by TMR Publishing Group | New Zealand<br>';
|
||||
$tt .= 'Telephone: +64 02108293806';
|
||||
$tt .= 'Email: publisher@tmrjournals.com';
|
||||
$tt .= 'www.tmrjournals.com';
|
||||
$maidata['email'] = $data['email'];
|
||||
$maidata['title'] = 'Thank you for subscribing.';
|
||||
$maidata['content'] = $tt;
|
||||
$maidata['tmail'] = 'publicrelations@tmrjournals.com';
|
||||
$maidata['tpassword'] = 'pRWU999999';
|
||||
Queue::push('app\api\job\mail@fire', $maidata, "mail");
|
||||
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
@@ -682,9 +697,32 @@ class Journal extends Controller {
|
||||
}
|
||||
$insert['topic_id'] = $data['topic_id'];
|
||||
$insert['email'] = $data['email'];
|
||||
$this->subscribe_topic_obj->insert($insert);
|
||||
$id = $this->subscribe_topic_obj->insertGetId($insert);
|
||||
//发送邮件感谢
|
||||
$tt = 'Dear Researcher,<br><br>';
|
||||
$tt .= 'Welcome you to the email alert for the latest research and more. Thank you for your interest in our publications and topics.<br>';
|
||||
$tt .= '<a href="http://journalapi.tmrjournals.com/public/index.php/api/Journal/UnsubscribeTopic/snum/'.$id.'">Unsubscribe</a><br>';
|
||||
$tt .= 'This service is provided by TMR Publishing Group | New Zealand<br>';
|
||||
$tt .= 'Telephone: +64 02108293806';
|
||||
$tt .= 'Email: publisher@tmrjournals.com';
|
||||
$tt .= 'www.tmrjournals.com';
|
||||
$maidata['email'] = $data['email'];
|
||||
$maidata['title'] = 'Thank you for subscribing.';
|
||||
$maidata['content'] = $tt;
|
||||
$maidata['tmail'] = 'publicrelations@tmrjournals.com';
|
||||
$maidata['tpassword'] = 'pRWU999999';
|
||||
Queue::push('app\api\job\mail@fire', $maidata, "mail");
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
public function UnsubscribeTopic($snum){
|
||||
$this->subscribe_topic_obj->where('subscribe_topic_id',$snum)->update(['state'=>1]);
|
||||
echo 'Unsubscribe successfully!';
|
||||
}
|
||||
public function UnsubscribeJournal($snum){
|
||||
$this->subscribe_journal_obj->where('subscribe_journal_id',$snum)->update(['state'=>1]);
|
||||
echo 'Unsubscribe successfully!';
|
||||
}
|
||||
|
||||
public function testEmail() {
|
||||
// phpinfo();die;
|
||||
|
||||
@@ -27,6 +27,7 @@ class Special extends Controller {
|
||||
protected $article_to_topic_obj = '';
|
||||
protected $sys_scient_obj = '';
|
||||
protected $sys_book_obj = '';
|
||||
protected $journal_special_alert_obj = '';
|
||||
|
||||
public function __construct(\think\Request $request = null) {
|
||||
parent::__construct($request);
|
||||
@@ -44,6 +45,7 @@ class Special extends Controller {
|
||||
$this->article_to_topic_obj = Db::name('article_to_topic');
|
||||
$this->sys_scient_obj = Db::name('system_scient');
|
||||
$this->sys_book_obj = Db::name('system_books');
|
||||
$this->journal_special_alert_obj = Db::name('journal_special_alert');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -292,5 +294,25 @@ class Special extends Controller {
|
||||
}
|
||||
return $frag;
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 客座期刊(获取客座期刊文章)
|
||||
* @description 客座期刊(获取客座期刊文章)
|
||||
* @author wangjinlei
|
||||
* @url /api/Special/getSpecialArticles
|
||||
* @method POST
|
||||
*
|
||||
* @param name:journal_id type:int require:1 desc:客座期刊id
|
||||
*
|
||||
* @return alertInfo:客座期刊提示语#
|
||||
*/
|
||||
public function getSpecialAlert(){
|
||||
$data = $this->request->post();
|
||||
$info = $this->journal_special_alert_obj->where('journal_id',$data['journal_id'])->find();
|
||||
|
||||
$re['alertInfo'] = $info;
|
||||
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user