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);