From 01c0302b8a28becd19df3f2e43a4e89144d81e85 Mon Sep 17 00:00:00 2001 From: JerryYan <792602257@qq.com> Date: Wed, 19 Aug 2020 12:57:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A4=E6=98=93=E8=A7=84=E5=88=99=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hyhproject/admin/model/TradeRule.php | 1 + hyhproject/app/controller/TradeRule.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hyhproject/admin/model/TradeRule.php b/hyhproject/admin/model/TradeRule.php index 69745a2..59b7ec9 100644 --- a/hyhproject/admin/model/TradeRule.php +++ b/hyhproject/admin/model/TradeRule.php @@ -78,6 +78,7 @@ class TradeRule extends Base public function edit(){ $id = input('post.id/d'); $data = input('post.'); + $data['content'] = htmlspecialchars_decode($data['content']); WSTUnset($data,'id,dataFlag,isShow,create_time'); Db::startTrans(); try{ diff --git a/hyhproject/app/controller/TradeRule.php b/hyhproject/app/controller/TradeRule.php index 2807365..380b694 100644 --- a/hyhproject/app/controller/TradeRule.php +++ b/hyhproject/app/controller/TradeRule.php @@ -13,6 +13,10 @@ class TradeRule extends Base $model = Db::name("trade_rule")->field(true) ->order("create_time", "desc") ->select(); + foreach ($model as $detail) { + $detail['content'] = htmlspecialchars_decode($detail['content']); + return $detail; + } return WSTReturn("OK", 1, $model); } @@ -21,8 +25,8 @@ class TradeRule extends Base if(($id = (int)input( 'id', 0)) > 0){ $detail = Db::name("trade_rule")->field(true) ->where(["id"=>$id])->find(); - $detail['content'] = htmlspecialchars_decode($detail['content']); if(!$detail) return WSTReturn("该条内容已被删除",0); + $detail['content'] = htmlspecialchars_decode($detail['content']); return WSTReturn("OK", 1, $detail); } return WSTReturn("异常请求",0);