quanwei
2025-10-28 36cacbaf78e510713002fcd5e3d61cece2e01421
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
 
namespace app\shop\controller\plus;
 
use app\shop\controller\Controller;
use app\shop\model\settings\Setting as SettingModel;
use app\shop\model\plus\sign\Sign as SignModel;
 
/**
 * Class Officia
 * 签到有礼控制器
 * @package app\shop\controller\plus\officia
 */
class Sign extends Controller
{
 
    private $days = [2, 3, 4, 5, 6, 7, 15, 30, 60];
    private $sign_date = [7, 15, 30];
 
    /**
     * 签到有礼配置
     */
    public function index()
    {
        $key = 'sign';
        if($this->request->isGet()){
            $vars['values'] = SettingModel::getItem($key);
            return $this->renderSuccess('', compact('vars'));
        }
 
        $model = new SettingModel;
        if ($model->edit($key, $this->postData())) {
            return $this->renderSuccess('操作成功');
        }
    }
 
    /**
     * 获取用户签到列表
     */
    public function lists()
    {
        $model = new SignModel;
        $list = $model->getList($this->postData(), $this->days, $this->sign_date);
 
        return $this->renderSuccess('', compact('list'));
    }
 
}