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'; }