This commit is contained in:
wangjinlei
2023-07-14 15:41:27 +08:00
parent 87464357c2
commit 3f289cebec
7 changed files with 100 additions and 13 deletions

View File

@@ -70,9 +70,12 @@ class Publish extends Base
}
$pro_info = $this->production_article_obj->where('doi',$a[1])->where('state',2)->find();
if (!$pro_info){
$pid = $this->createEmptyProduction($v);
$articles[$k]['refers'] = [];
$articles[$k]['p_article_id'] = $pid;
continue;
}
$articles[$k]['p_article_id'] = $pro_info['p_article_id'];
$articles[$k]['refers'] = $this->production_article_refer_obj->where("p_article_id",$pro_info['p_article_id'])->where('state',0)->order("index")->select();
}
@@ -159,6 +162,29 @@ class Publish extends Base
return jsonSuccess($re);
}
/**添加refer通过拷贝word的形式
* @return void
*/
public function addRefersByWord(){
$data = $this->request->post();
$rule = new Validate([
"p_article_id"=>"require",
"contents"=>"require|array"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
foreach ($data['contents'] as $k => $v){
$insert['p_article_id'] = $data['p_article_id'];
$insert['refer_frag'] = $v;
$insert['refer_type'] = "other";
$insert['cs'] = 0;
$insert['index'] = $k;
$this->production_article_refer_obj->insert($insert);
}
return jsonSuccess([]);
}
/**
* 编辑文章的客座期刊信息
*/