1
This commit is contained in:
@@ -34,8 +34,15 @@ class Preaccept extends Base
|
||||
if ($production_info == null) {
|
||||
return jsonError("Object is null");
|
||||
}
|
||||
$dois = $this->production_article_refer_obj->where("p_article_id", $production_info['p_article_id'])->where("refer_doi","<>","")->where("state",0)->group("refer_doi")->having("count(*)>1")->column("refer_doi");
|
||||
$list = $this->production_article_refer_obj->where("p_article_id", $production_info['p_article_id'])->where('state', 0)->order("index")->select();
|
||||
|
||||
foreach ($list as $k => $v){
|
||||
if(in_array($v['refer_doi'],$dois)){
|
||||
$list[$k]['is_repeat'] = 1;
|
||||
}else{
|
||||
$list[$k]['is_repeat'] = 0;
|
||||
}
|
||||
}
|
||||
$re["refers"] = $list;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
@@ -736,22 +743,7 @@ class Preaccept extends Base
|
||||
if(!$mains){
|
||||
$this->addArticleMainEx($data['article_id']);
|
||||
}
|
||||
$mains = $this->article_main_obj->where("article_id",$data['article_id'])->whereIn("state",[0,2])->order("sort asc")->select();
|
||||
if(!$mains){
|
||||
return jsonError("error");
|
||||
}
|
||||
foreach ($mains as $k=>$main) {
|
||||
$mains[$k]['checks'] = $this->article_main_check_obj->where("am_id",$main['am_id'])->where("state",0)->select();
|
||||
if($main['type']==0){
|
||||
continue;
|
||||
}elseif($main['type']==1){
|
||||
$c_d = $this->article_main_image_obj->where("ami_id",$main['ami_id'])->find();
|
||||
$mains[$k]['image'] = $c_d;
|
||||
}else{
|
||||
$c_d_t = $this->article_main_table_obj->where("amt_id",$main['amt_id'])->find();
|
||||
$mains[$k]['table'] = $c_d_t;
|
||||
}
|
||||
}
|
||||
$mains = getArticleMains($data['article_id']);
|
||||
$re['list'] = $mains;
|
||||
|
||||
return jsonSuccess($re);
|
||||
@@ -776,7 +768,7 @@ class Preaccept extends Base
|
||||
if($n_list[0]['type']>0||$n_list[0]['content']!=""){
|
||||
$this->addBRow($am_info['article_id'],$data['am_id']);
|
||||
}
|
||||
$this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h1"=>1,"is_h2"=>0,"is_h3"=>0,"content"=>"<b><i>".$am_info['content']."</i></b>"]);
|
||||
$this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h1"=>1,"is_h2"=>0,"is_h3"=>0]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
@@ -794,7 +786,7 @@ class Preaccept extends Base
|
||||
if($p_list&&($p_list[0]['type']>0||$p_list[0]['content']!="")){
|
||||
$this->addBRow($am_info['article_id'],$p_list[0]['am_id']);
|
||||
}
|
||||
$this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h1"=>0,"is_h2"=>1,"is_h3"=>0,"content"=>"<b>".$am_info['content']."</b>"]);
|
||||
$this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h1"=>0,"is_h2"=>1,"is_h3"=>0]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
@@ -807,7 +799,19 @@ class Preaccept extends Base
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$am_info = $this->article_main_obj->where("am_id",$data['am_id'])->find();
|
||||
$this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h1"=>0,"is_h2"=>0,"is_h3"=>1,"content"=>"<b>".$am_info['content']."</b>"]);
|
||||
$this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h1"=>0,"is_h2"=>0,"is_h3"=>1]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
public function changeNormal(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"am_id"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h1"=>0,"is_h2"=>0,"is_h3"=>0]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
@@ -820,7 +824,15 @@ class Preaccept extends Base
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$this->addBRow($data['article_id'],$data['am_id']);
|
||||
if(isset($data['row'])){
|
||||
$row = (int)$data['row'];
|
||||
}else{
|
||||
$row = 1;
|
||||
}
|
||||
while ($row>0){
|
||||
$this->addBRow($data['article_id'],$data['am_id']);
|
||||
$row--;
|
||||
}
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user