From 57c0f6736d10bb627b30fd13705c7738e26cc7fc Mon Sep 17 00:00:00 2001 From: chenzhi Date: Mon, 11 Oct 2021 17:13:28 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A8=E5=B9=BF?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E5=85=AC=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PromoteNoticeController.class.php | 26 ++++++ .../Admin/View/PromoteNotice/edit.html | 87 +++++++++++++++++++ .../Controller/PromoteController.class.php | 10 ++- .../Home/View/default/Promote/index.html | 53 +++++++++-- 4 files changed, 170 insertions(+), 6 deletions(-) create mode 100644 Application/Admin/Controller/PromoteNoticeController.class.php create mode 100644 Application/Admin/View/PromoteNotice/edit.html diff --git a/Application/Admin/Controller/PromoteNoticeController.class.php b/Application/Admin/Controller/PromoteNoticeController.class.php new file mode 100644 index 000000000..8fa3c526d --- /dev/null +++ b/Application/Admin/Controller/PromoteNoticeController.class.php @@ -0,0 +1,26 @@ +find(); + $this->assign('data',$data); + $this->display(); + } + + public function doEdit() + { + $res = M("promote_notice","tab_")->save($_REQUEST); + if(!$res){ + $this->ajaxReturn(["status"=>0,"msg"=>"保存失败"]); + } + $this->ajaxReturn(["status"=>1,"msg"=>"修改并保存成功"]); + } +} diff --git a/Application/Admin/View/PromoteNotice/edit.html b/Application/Admin/View/PromoteNotice/edit.html new file mode 100644 index 000000000..a4d663dcf --- /dev/null +++ b/Application/Admin/View/PromoteNotice/edit.html @@ -0,0 +1,87 @@ + + + + + + + + + + +
+ + +
+ + + + + + + + + + +
是否开启: + + + +
公告内容: + +
+
+
+ + +
+
+ + +
+ + + diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index c54ea9248..17c6c7adc 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -298,9 +298,17 @@ class PromoteController extends BaseController $this->assign("tips",$tips); $this->assign("message",$message); $this->meta_title = "首页"; + //首页公告 + $this->getIndexTip(); $this->display(); } - + public function getIndexTip() + { + $data = M("promote_notice","tab_")->where("is_open = 1")->getField('content'); + if($data){ + $this->assign('index_tip',$data); + } + } public function popRuleDetail($id=0, $p=1, $row=1, $force=false, $pop = false) { $promoteBelong = M('promote', 'tab_')->where(['id'=>get_pid()])->getField('company_belong'); diff --git a/Application/Home/View/default/Promote/index.html b/Application/Home/View/default/Promote/index.html index 718ea9b7f..b46351e03 100644 --- a/Application/Home/View/default/Promote/index.html +++ b/Application/Home/View/default/Promote/index.html @@ -3,6 +3,10 @@ + + + +
    @@ -209,12 +213,51 @@ {$_page}
- . - - - - + + + + + +