20201112
This commit is contained in:
@@ -125,6 +125,22 @@ class Journal extends Controller {
|
||||
return json(['code' => 0, 'msg' => 'success', 'data' => ['journal' => $journal_info, 'relats' => $relatelist, 'journalAbs' => $absList, 'journalStage' => $stageList]]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取期刊信息通过issn
|
||||
* @description 获取期刊信息通过issn
|
||||
* @author wangjinlei
|
||||
* @url /api/Journal/getJournalByIssn
|
||||
* @method POST
|
||||
*
|
||||
* @param name:issn type:string require:1 desc:issn号
|
||||
*
|
||||
*/
|
||||
public function getJournalByIssn(){
|
||||
$data = $this->request->post();
|
||||
$journal_info = $this->journal_obj->where('issn',$data['issn'])->find();
|
||||
return jsonSuccess($journal_info);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取期刊话题
|
||||
* @description 获取期刊话题
|
||||
@@ -724,13 +740,6 @@ class Journal extends Controller {
|
||||
public function getTopicForSubscribe() {
|
||||
$data = $this->request->post();
|
||||
$list = $this->journal_topic_obj->where('journal_id', $data['journal_id'])->where('state', 0)->where('level', 2)->select();
|
||||
// $pids = [];
|
||||
// foreach ($list as $k => $v){
|
||||
// if(!in_array($v['parent_id'], $pids)){
|
||||
// $pids[] = $v['parent_id'];
|
||||
// }
|
||||
// }
|
||||
// $tlist = $this->journal_topic_obj->where('journal_topic_id','in',$pids)->where('state',0)->select();
|
||||
|
||||
$re['topics'] = $list;
|
||||
return jsonSuccess($re);
|
||||
@@ -778,6 +787,49 @@ class Journal extends Controller {
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 添加期刊订阅通过issn
|
||||
* @description 添加期刊订阅通过issn
|
||||
* @author wangjinlei
|
||||
* @url /api/Journal/addSubscribeByIssn
|
||||
* @method POST
|
||||
*
|
||||
* @param name:issn type:string require:1 desc:issn号
|
||||
* @param name:email type:string require:1 desc:邮件地址
|
||||
*/
|
||||
public function addSubscribeByIssn(){
|
||||
$data = $this->request->post();
|
||||
$journal_info = $this->journal_obj->where('issn',$data['issn'])->find();
|
||||
//去重
|
||||
$repeat = $this->subscribe_journal_obj
|
||||
->where('journal_id', $journal_info['journal_id'])
|
||||
->where('email', $data['email'])
|
||||
->where('state', 0)
|
||||
->find();
|
||||
if ($repeat) {
|
||||
return jsonError('repeat subscribe!');
|
||||
}
|
||||
$insert['journal_id'] = $journal_info['journal_id'];
|
||||
$insert['email'] = $data['email'];
|
||||
$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'] = 'Traditional Medicine Research ISSN 2413-3973';
|
||||
$maidata['content'] = $tt;
|
||||
$maidata['tmail'] = 'publicrelations@tmrjournals.com';
|
||||
$maidata['tpassword'] = 'pRWU999999';
|
||||
Queue::push('app\api\job\mail@fire', $maidata, "mail");
|
||||
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
public function pushEmail(){
|
||||
die;
|
||||
$list = $this->subscribe_journal_obj->where('journal_id',1)->select();
|
||||
@@ -911,12 +963,15 @@ class Journal extends Controller {
|
||||
// phpinfo();die;
|
||||
|
||||
|
||||
$tt = 'mytestemail.';
|
||||
$tt = '<form action="https://www.baidu.com" method="post">
|
||||
Email: <input type="text" name="fname"><br>
|
||||
<input type="submit" value="提交">
|
||||
</form>';
|
||||
$maidata['email'] = '751475802@qq.com';
|
||||
$maidata['title'] = '测试邮件1';
|
||||
$maidata['title'] = 'test';
|
||||
$maidata['content'] = $tt;
|
||||
$maidata['tmail'] = 'tmr@tmrjournals.com';
|
||||
$maidata['tpassword'] = 'Wu999999tm';
|
||||
$maidata['tpassword'] = 'Wu9999999999';
|
||||
Queue::push('app\api\job\mail@fire', $maidata, "mail");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user