| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?php
- namespace app\admin\controller;
- use think\admin\Controller;
- use think\admin\service\SystemService;
- use think\facade\Cache;
- use think\facade\Db;
- use think\facade\Request;
- class Sina extends Controller
- {
- /**
- * 修改聚合页配置
- * @auth true
- * @menu true
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- */
- public function groupPageConfig()
- {
- $this->_applyFormToken();
- if ($this->request->isGet()) {
- $this->title = '修改聚合页配置';
- $this->config = SystemService::instance()->getData("group:page:config");
- $this->fetch();
- } else {
- SystemService::instance()->setData('group:page:config', Request::post("config"));
- sysoplog('聚合页配置管理', "修改聚合页配置成功");
- $this->success('修改聚合页配置成功!');
- }
- }
- /**
- * 修改品牌任务配置
- * @auth true
- * @menu true
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- */
- public function brandTaskConfig()
- {
- $this->_applyFormToken();
- if ($this->request->isGet()) {
- $this->title = '修改品牌任务配置';
- $this->config = SystemService::instance()->getData("brand:task:config");
- $this->fetch();
- } else {
- SystemService::instance()->setData('brand:task:config', Request::post("config"));
- sysoplog('品牌任务配置管理', "修改品牌任务配置成功");
- $this->success('修改品牌任务配置成功!');
- }
- }
- /**
- * 修改活动规则
- * @auth true
- * @menu true
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- */
- public function rule()
- {
- $this->_applyFormToken();
- if ($this->request->isGet()) {
- $this->title = '修改活动规则配置';
- $this->config = SystemService::instance()->getData("activity:rule");
- $this->fetch();
- } else {
- SystemService::instance()->setData('activity:rule', Request::post("config"));
- sysoplog('品牌活动规则管理', "修改活动规则配置成功");
- $this->success('修改活动规则配置成功!');
- }
- }
- public function removeUserTask()
- {
- $this->_applyFormToken();
- if ($this->request->isGet()) {
- $this->title = '清除用户任务数据';
- $this->fetch();
- } else {
- $uid = Request::post('uid');
- $dateForRedis = date('Ymd');
- $redisKey = "t:{$dateForRedis}:" . $uid;
- Cache::delete($redisKey);
- Cache::delete('u:f:' . $uid);
- Db::table('awards_user_task')->where('uid', $uid)->where('date', date('Y-m-d'))->delete();
- sysoplog('测试管理', "清除用户任务数据");
- $this->success('清除用户任务数据成功!');
- }
- }
- }
|