12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace app\admin\controller\task;
- use app\common\controller\Backend;
- use fast\Tree;
- class Task extends Backend
- {
-
- protected $model = null;
- public function _initialize()
- {
- parent::_initialize();
- $this->model = new \app\admin\model\Task;
- $this->view->assign("statusList", $this->model->getStatusList());
- }
-
- public function detail(){
- if ($this->request->isAjax()) {
- if (!$this->auth->isSuperAdmin()) {
- $this->error(__('Access is allowed only to the super management group'));
- }
- $this->model = model('AuthRule');
-
- $ruleList = \think\Db::name("task_steps")->order('weigh DESC,id ASC')->select();
- foreach ($ruleList as $k => &$v) {
- $v['name'] = __($v['name']);
- }
- unset($v);
- Tree::instance()->init($ruleList)->icon = [' ', ' ', ' '];
- $this->rulelist = Tree::instance()->getTreeList(Tree::instance()->getTreeArray(0), 'name');
- $list = $this->rulelist;
- $total = count($this->rulelist);
- $result = array("total" => $total, "rows" => $list);
- return json($result);
- }
- return $this->view->fetch();
- }
- }
|