This commit is contained in:
wangjinlei
2022-12-30 11:41:32 +08:00
parent 9144a49c2b
commit be445b252b
2 changed files with 49 additions and 1 deletions

View File

@@ -469,6 +469,20 @@ class Article extends Controller {
Db::startTrans(); Db::startTrans();
$aid = $this->article_obj->insertGetId($insert); $aid = $this->article_obj->insertGetId($insert);
//处理斜体
$ltai_res = true;
if(isset($data['ltai'])&&$data['ltai']!=''){
$ltai = explode(',',$data['ltai']);
$ltai_input = [];
foreach($ltai as $v)
{
$cache_input['article_id'] = $aid;
$cache_input['content'] = $v;
$ltai_input[] = $cache_input;
}
$ltai_res = $this->article_ltai_obj->insertAll($ltai_input);
}
//处理作者 //处理作者
try{ try{
$authors = object_to_array(json_decode($data['authors'])); $authors = object_to_array(json_decode($data['authors']));
@@ -511,7 +525,7 @@ class Article extends Controller {
return jsonError($e->getMessage()); return jsonError($e->getMessage());
} }
if($aid&&$organ_res&&$author_res&&$ato_res&&$ca_au_id){ if($aid&&$organ_res&&$ltai_res&&$author_res&&$ato_res&&$ca_au_id){
Db::commit(); Db::commit();
$this->pushDoiToCrossref($data['doi'],$aid); $this->pushDoiToCrossref($data['doi'],$aid);
return jsonSuccess([]); return jsonSuccess([]);

View File

@@ -910,6 +910,40 @@ class Journal extends Controller
return jsonSuccess([]); return jsonSuccess([]);
} }
public function pushEmailToExten(){
$data = $this->request->post();
$rule = new Validate([
'num'=>'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$url = "http://api.tmrjournals.com/public/index.php/api/Auto/qqqq";
$pag = [];
$pag['num'] = $data['num'];
$res = object_to_array(json_decode(myPost($url, $pag)));
$tt = "Dear researchers in liver cancer,<br/><br/>";
$tt .= 'I am pleased to promote a new paper published in our journal to you. The paper is titled "A Comprehensive Review of Research Progress in Chinese Medicines for Primary Liver Cancer Treatment", and is available on doi.org: <a href="https://doi.org/10.53388/TMR20220207263">10.53388/TMR20220207263</a>.<br/><br/>';
$tt .= '<a href="https://www.tmrjournals.com/public/articlePDF/20220727/article.pdf">download PDF</a><br/><br/>';
$tt .= 'This study summarizes the common monomial Chinese herbal medicines and their components and formulae. It also investigates the proprietary Chinese medicines used to treat primary liver cancer and reviews the clinical trial-based literature of Chinese herbal medicines associated with liver cancer treatment. The results confirmed the safety and efficacy of traditional Chinese medicine (TCM) in liver cancer treatment.<br/><br/>';
$tt .= 'We believe that this paper will be helpful to your research work and provide you with valuable references.<br/><br/>Thank you for your attention and we hope to stay in touch.<br/><br/>Sincerely,<br/><br/>Editor-Nuoxi Pi<br/>Traditional Medicine Research';
// $ll = ['751475802@qq.com','849192806@qq.com'];
foreach($res['data']['list'] as $v){
// foreach($ll as $v){
$maidata['email'] = $v['email'];
// $maidata['email'] = $v;
$maidata['title'] = "New study on Chinese medicines for liver cancer treatment";
$maidata['content'] = $tt;
Queue::push('app\api\job\mail@propa', $maidata, "mail");
}
return jsonSuccess([]);
}
public function pushEmailToUser(){ public function pushEmailToUser(){
$data = $this->request->post(); $data = $this->request->post();
$rule = new Validate([ $rule = new Validate([