This commit is contained in:
wangjinlei
2023-06-30 14:46:38 +08:00
parent 504b1b9e06
commit b251027249
2 changed files with 46 additions and 5 deletions

View File

@@ -95,6 +95,40 @@ class Preaccept extends Base
}
}
/**非doi形式添加refer节点
* @return void
*/
public function addReferNotdoi(){
$data = $this->request->post();
$rule = new Validate([
"article_id"=>"require",
"pre_p_refer_id"=>"require",
"author"=>"require",
"title"=>"require",
"joura"=>"require",
"dateno"=>"require",
"doilink"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$p_info = $this->production_article_obj->where('article_id',$data['article_id'])->where('state',0)->find();
$pre_refer = $this->production_article_refer_obj->where('p_refer_id',$data['pre_p_refer_id'])->find();
$insert['p_article_id'] = $data['p_article_id'];
$insert['index'] = $pre_refer['index']+1;
$insert['author'] = trim($data['author']);
$insert['title'] = trim($data['title']);
$insert['joura'] = trim($data['joura']);
$insert['dateno'] = trim($data['dateno']);
$insert['doilink'] = trim($data['doilink']);
$insert['refer_doi'] = trim($data['doilink']);
$insert['is_web'] = 1;
$insert['cs'] = 1;
$adId = $this->production_article_refer_obj->insertGetId($insert);
$this->production_article_refer_obj->where('p_article_id',$p_info['p_article_id'])->where("p_refer_id","<>",$adId)->where("index",">",$pre_refer['index'])->where('state',0)->setInc('index');
return jsonSuccess([]);
}
// public function aaa(){
// $list = $this->production_article_refer_obj->where('p_article_id',423)->where('state',0)->where('index',">",0)->setInc('index');
// dump($list);