quanwei
18 hours ago c441dea81bd86bdfb12dff35821fed51f4cc91c2
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
<?php
 
namespace app\operations\controller\plus;
 
use app\operations\controller\Controller;
use app\operations\model\settings\Setting as SettingModel;
 
/**
 * 任务控制器
 */
class Task extends Controller
{
    /**
     * 任务配置
     */
    public function index()
    {
        $key = 'task';
        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('操作成功');
        }
        return $this->renderError($model->getError()?:'操作失败');
    }
 
}