From fe37d065c7053d5f078469e3b98b80a48aeec4c7 Mon Sep 17 00:00:00 2001 From: JerryYan <792602257@qq.com> Date: Thu, 28 May 2020 22:03:21 +0800 Subject: [PATCH] =?UTF-8?q?TradeRule=E5=90=8E=E5=8F=B0=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hyhproject/admin/model/TradeRule.php | 13 +++++++++++-- hyhproject/admin/view/trade_rule/edit.html | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/hyhproject/admin/model/TradeRule.php b/hyhproject/admin/model/TradeRule.php index 62c3375..5e1d927 100644 --- a/hyhproject/admin/model/TradeRule.php +++ b/hyhproject/admin/model/TradeRule.php @@ -8,10 +8,11 @@ use think\Db; class TradeRule extends Base { + protected $createTime = "create_time"; + protected $dateFormat = false; + protected $updateTime = false; /** - * 分页 - */ public function pageQuery(){ @@ -61,6 +62,14 @@ class TradeRule extends Base return WSTReturn($this->getError(),-1); } } + /** + * 获取指定对象 + */ + public function getById($id){ + $single = $this->where(['id'=>$id,'dataFlag'=>1])->find(); + $single['content'] = htmlspecialchars_decode($single['content']); + return $single; + } /** * 编辑 diff --git a/hyhproject/admin/view/trade_rule/edit.html b/hyhproject/admin/view/trade_rule/edit.html index 95eee9e..76d5552 100644 --- a/hyhproject/admin/view/trade_rule/edit.html +++ b/hyhproject/admin/view/trade_rule/edit.html @@ -10,8 +10,8 @@