From f0a6e6b4ff9f6b5935a1369b2b90a1f6c27721a1 Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Wed, 4 Nov 2020 10:50:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E8=AE=BE=E7=BD=AE=E6=A0=87=E9=A2=98=E5=92=8C?= =?UTF-8?q?=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Forms/v3/ProgramShareCardForm.php | 64 +++++++++++++++++++++ app/Libs/Redis/RedisKey.php | 1 + 2 files changed, 65 insertions(+) create mode 100644 app/Admin/Forms/v3/ProgramShareCardForm.php diff --git a/app/Admin/Forms/v3/ProgramShareCardForm.php b/app/Admin/Forms/v3/ProgramShareCardForm.php new file mode 100644 index 0000000..0d486e7 --- /dev/null +++ b/app/Admin/Forms/v3/ProgramShareCardForm.php @@ -0,0 +1,64 @@ + $flashSale, + 'group_buy' => $groupBuy, + 'new_product' => $newProduct, + ]; + + $res = Redis::hmset(RedisKey::PROGRAM_SHARE_CARD , $data); + if($res){ + return $this->success('修改成功','/goods_activity'); + }else{ + return $this->error('修改失败'); + } + } + + /** + * Build a form here. + */ + public function form() + { + $data = Redis::hgetall(RedisKey::PROGRAM_SHARE_CARD); + + $flashSale = isset($data['flash_sale'])?$data['flash_sale']:0; + + $this->display('setting' , '设置')->value('小程序分享卡片设置'); + + } + + /** + * The data of the form. + * + * @return array + */ + public function default() + { + return []; + } + +} diff --git a/app/Libs/Redis/RedisKey.php b/app/Libs/Redis/RedisKey.php index 1ce5a70..c078a39 100644 --- a/app/Libs/Redis/RedisKey.php +++ b/app/Libs/Redis/RedisKey.php @@ -9,4 +9,5 @@ class RedisKey const ACTIVITY_TYPE_LIMIT_NUMS = 'activity_type_limit_nums'; + const PROGRAM_SHARE_CARD = 'program_share_card'; }