From c6b52d2bbd02cb724c3483ecc9c4fb306775d5dd Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Tue, 14 Jan 2025 14:22:59 +0800 Subject: [PATCH] 1 --- application/api/controller/Base.php | 1 + application/api/controller/Publish.php | 70 ++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/application/api/controller/Base.php b/application/api/controller/Base.php index e48ec31..60f5af5 100644 --- a/application/api/controller/Base.php +++ b/application/api/controller/Base.php @@ -620,6 +620,7 @@ class Base extends Controller ->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id=t_board_to_journal.user_id", "left") ->where('t_board_to_journal.journal_id', $journal_id) ->where('t_board_to_journal.state', 0) + ->order("t_user.realname") ->select(); foreach ($boards as $val) { if ($aar) { diff --git a/application/api/controller/Publish.php b/application/api/controller/Publish.php index 9990a2c..c52d5da 100644 --- a/application/api/controller/Publish.php +++ b/application/api/controller/Publish.php @@ -151,6 +151,76 @@ class Publish extends Base return jsonSuccess($re); } + public function createHtmlForType2(){ + $data = $this->request->post(); + $rule = new Validate([ + "article_id"=>"require" + ]); + if(!$rule->check($data)){ + return jsonError($rule->getError()); + } + $product = $this->production_article_obj->where("w_article_id",$data['article_id'])->find(); + if(!$product){ + return jsonError("system error,no product for article"); + } + $check = $this->article_main_obj->where("article_id",$product['article_id'])->whereIn("state",[0,2])->find(); + if(!$check){ + $this->addArticleMainEx($product['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) { + 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; + + return jsonSuccess($re); + + } + + public function getHtmlForType2(){ + $data = $this->request->post(); + $rule = new Validate([ + "article_id"=>"require" + ]); + if(!$rule->check($data)){ + return jsonError($rule->getError()); + } + $product = $this->production_article_obj->where("w_article_id",$data['article_id'])->find(); + if(!$product){ + return jsonError("system error,no product for article"); + } + $check = $this->article_main_obj->where("article_id",$product['article_id'])->whereIn("state",[0,2])->find(); + if(!$check){ + return jsonError("not find"); + } + $mains = $this->article_main_obj->where("article_id",$data['article_id'])->whereIn("state",[0,2])->order("sort asc")->select(); + 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; + + return jsonSuccess($re); + } + /** * 获取publish文章 */