1
This commit is contained in:
@@ -34,8 +34,15 @@ class Preaccept extends Base
|
|||||||
if ($production_info == null) {
|
if ($production_info == null) {
|
||||||
return jsonError("Object is 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();
|
$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;
|
$re["refers"] = $list;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
@@ -736,22 +743,7 @@ class Preaccept extends Base
|
|||||||
if(!$mains){
|
if(!$mains){
|
||||||
$this->addArticleMainEx($data['article_id']);
|
$this->addArticleMainEx($data['article_id']);
|
||||||
}
|
}
|
||||||
$mains = $this->article_main_obj->where("article_id",$data['article_id'])->whereIn("state",[0,2])->order("sort asc")->select();
|
$mains = getArticleMains($data['article_id']);
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$re['list'] = $mains;
|
$re['list'] = $mains;
|
||||||
|
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
@@ -776,7 +768,7 @@ class Preaccept extends Base
|
|||||||
if($n_list[0]['type']>0||$n_list[0]['content']!=""){
|
if($n_list[0]['type']>0||$n_list[0]['content']!=""){
|
||||||
$this->addBRow($am_info['article_id'],$data['am_id']);
|
$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([]);
|
return jsonSuccess([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -794,7 +786,7 @@ class Preaccept extends Base
|
|||||||
if($p_list&&($p_list[0]['type']>0||$p_list[0]['content']!="")){
|
if($p_list&&($p_list[0]['type']>0||$p_list[0]['content']!="")){
|
||||||
$this->addBRow($am_info['article_id'],$p_list[0]['am_id']);
|
$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([]);
|
return jsonSuccess([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -807,7 +799,19 @@ class Preaccept extends Base
|
|||||||
return jsonError($rule->getError());
|
return jsonError($rule->getError());
|
||||||
}
|
}
|
||||||
$am_info = $this->article_main_obj->where("am_id",$data['am_id'])->find();
|
$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([]);
|
return jsonSuccess([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -820,7 +824,15 @@ class Preaccept extends Base
|
|||||||
if(!$rule->check($data)){
|
if(!$rule->check($data)){
|
||||||
return jsonError($rule->getError());
|
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([]);
|
return jsonSuccess([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -586,26 +586,15 @@ class Production extends Base
|
|||||||
return jsonError($rule->getError());
|
return jsonError($rule->getError());
|
||||||
}
|
}
|
||||||
$this->refuseReferIndex($data['p_article_id']);
|
$this->refuseReferIndex($data['p_article_id']);
|
||||||
$list = $this->production_article_refer_obj
|
$dois = $this->production_article_refer_obj->where("p_article_id", $data['p_article_id'])->where("refer_doi","<>","")->where("state",0)->group("refer_doi")->having("count(*)>1")->column("refer_doi");
|
||||||
// ->field("*,
|
$list = $this->production_article_refer_obj->where('p_article_id', $data['p_article_id'])->where('state', 0)->order("index")->select();
|
||||||
// CASE
|
foreach ($list as $k => $v){
|
||||||
// WHEN refer_doi != ''
|
if(in_array($v['refer_doi'],$dois)){
|
||||||
// AND refer_doi IS NOT NULL
|
$list[$k]['is_repeat'] = 1;
|
||||||
// AND refer_doi IN (
|
}else{
|
||||||
// SELECT refer_doi
|
$list[$k]['is_repeat'] = 0;
|
||||||
// FROM t_production_article_refer
|
}
|
||||||
// WHERE p_article_id = ".$data['p_article_id']."
|
}
|
||||||
// AND state = 0
|
|
||||||
// GROUP BY refer_doi
|
|
||||||
// HAVING COUNT(*) > 1
|
|
||||||
// ) THEN 1
|
|
||||||
// ELSE 0
|
|
||||||
// END AS repeat
|
|
||||||
// ")
|
|
||||||
->where('p_article_id', $data['p_article_id'])->where('state', 0)->order("index")->select();
|
|
||||||
|
|
||||||
|
|
||||||
// echo $this->production_article_refer_obj->getLastSql();
|
|
||||||
$re['refers'] = $list;
|
$re['refers'] = $list;
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
@@ -1209,7 +1198,13 @@ class Production extends Base
|
|||||||
$tables[$info['amt_id']] = $arr_table;
|
$tables[$info['amt_id']] = $arr_table;
|
||||||
$main_string = "<table tableId='".$info['amt_id']."'/>";
|
$main_string = "<table tableId='".$info['amt_id']."'/>";
|
||||||
}else{
|
}else{
|
||||||
$main_string = $item['content'];
|
if($item['is_h1']==1){
|
||||||
|
$main_string = "<b><i>".$item['content']."</i></b>";
|
||||||
|
}else if($item['is_h2']==1||$item['is_h3']==1){
|
||||||
|
$main_string = "<b>".$item['content']."</b>";
|
||||||
|
}else{
|
||||||
|
$main_string = $item['content'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$mainList[] = $main_string;
|
$mainList[] = $main_string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,21 +213,7 @@ class Publish extends Base
|
|||||||
$pra = [];
|
$pra = [];
|
||||||
$pra['article_id'] = $data['article_id'];
|
$pra['article_id'] = $data['article_id'];
|
||||||
myPost($url, $pra);
|
myPost($url, $pra);
|
||||||
$mains = $this->article_main_obj->where("article_id",$product['article_id'])->whereIn("state",[0,2])->order("sort asc")->select();
|
$mains = getArticleMains($product['article_id']);
|
||||||
if(!$mains){
|
|
||||||
return jsonError("error");
|
|
||||||
}
|
|
||||||
foreach ($mains as $k=>$main) {
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$re['list'] = $mains;
|
$re['list'] = $mains;
|
||||||
|
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
@@ -250,18 +236,7 @@ class Publish extends Base
|
|||||||
if(!$check){
|
if(!$check){
|
||||||
return jsonError("not find");
|
return jsonError("not find");
|
||||||
}
|
}
|
||||||
$mains = $this->article_main_obj->where("article_id",$product['article_id'])->whereIn("state",[0,2])->order("sort asc")->select();
|
$mains = getArticleMains($product['article_id']);
|
||||||
foreach ($mains as $k=>$main) {
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$re['list'] = $mains;
|
$re['list'] = $mains;
|
||||||
|
|
||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
|
|||||||
@@ -152,6 +152,34 @@ function get_str()
|
|||||||
return md5($randstr . time());
|
return md5($randstr . time());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getArticleMains($article_id){
|
||||||
|
|
||||||
|
$article_mains_obj = Db::name("article_main");
|
||||||
|
$mains = $article_mains_obj->where("article_id",$article_id)->whereIn("state",[0,2])->order("sort asc")->select();
|
||||||
|
if(!$mains){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
foreach ($mains as $k=>$main) {
|
||||||
|
if($main['is_h1']==1){
|
||||||
|
$mains[$k]['content'] = "<b><i>".$main['content']."</i></b>";
|
||||||
|
}
|
||||||
|
if($main['is_h2']==1||$main['is_h3']==1){
|
||||||
|
$mains[$k]['content'] = "<b>".$main['content']."</b>";
|
||||||
|
}
|
||||||
|
$mains[$k]['checks'] = Db::name("article_main_check")->where("am_id",$main['am_id'])->where("state",0)->select();
|
||||||
|
if($main['type']==0){
|
||||||
|
continue;
|
||||||
|
}elseif($main['type']==1){
|
||||||
|
$c_d = Db::name("article_main_image")->where("ami_id",$main['ami_id'])->find();
|
||||||
|
$mains[$k]['image'] = $c_d;
|
||||||
|
}else{
|
||||||
|
$c_d_t = Db::name("article_main_table")->where("amt_id",$main['amt_id'])->find();
|
||||||
|
$mains[$k]['table'] = $c_d_t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $mains;
|
||||||
|
}
|
||||||
|
|
||||||
function getRandPassword()
|
function getRandPassword()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user