application/manage/controller/Job.php
public function index(Request $request)
    {
        $this->site_title = '任务列表';
        $job_logic = JobLogic::instance();
        
        // 队列列表
        $queue_list = $job_logic->getJobQueue();
        $this->assign('queue_list', $queue_list);
        
        $map = [];
        
        // 队列
        $queue = $request->param('queue', '');
        if (! empty($queue)) {
            $map['queue'] = $queue;
        }
        $this->assign('queue', $queue);
        
        // 关键词
        $keyword = $request->param('keyword', '');
        if (! empty($keyword)) {
            $map['payload'] = [
                'exp',
                'like \'%' . str_replace([
                    '"',
                    '\\'
                ], [
                    '',
                    '%'
                ], json_encode($keyword)) . '%\''
            ];
        }
        $this->assign('keyword', $keyword);
        
        // 总数
        $total_count = $job_logic->model->where($map)->count();
        $this->assign('total_count', $total_count);
        
        // 列表
        $list = $job_logic->model->where($map)->paginate($this->rows_num);
        $list_new = [];
        foreach ($list as $vo) {
            $vo['payload'] = var_export(json_decode($vo['payload'], true), true);
            $list_new[] = $vo;
        }
        $this->assign('list', $list_new);
        $this->assign('page', $list->render());
        
        return $this->fetch();
    }
public function index(Request $request)
    {
        $this->site_title = '任务列表';
        $job_logic = JobLogic::instance();
        
        // 队列列表
        $queue_list = $job_logic->getJobQueue();
        $this->assign('queue_list', $queue_list);
        
        $map = [];
        
        // 队列
        $queue = $request->param('queue', '');
        if (! empty($queue)) {
            $map['queue'] = $queue;
        }
        $this->assign('queue', $queue);
        
        // 关键词
        $keyword = $request->param('keyword', '');
        if (! empty($keyword)) {
            $map['payload'] = [
                'exp',
                'like \'%' . str_replace([
                    '"',
                    '\\'
                ], [
                    '',
                    '%'
                ], json_encode($keyword)) . '%\''
            ];
        }
        $this->assign('keyword', $keyword);
        
        // 总数
        $total_count = $job_logic->model->where($map)->count();
        $this->assign('total_count', $total_count);
        
        // 列表
        $list = $job_logic->model->where($map)->paginate($this->rows_num);
        $list_new = [];
        foreach ($list as $vo) {
            $vo['payload'] = var_export(json_decode($vo['payload'], true), true);
            $list_new[] = $vo;
        }
        $this->assign('list', $list_new);
        $this->assign('page', $list->render());
        
        return $this->fetch();
    }
public function index ( Request $ request ) { $ this -> site_title = '任务列表'; $ job_logic = JobLogic :: instance ( ) ; // 队列列表 $ queue_list = $ job_logic -> getJobQueue ( ) ; $ this -> assign ( 'queue_list' , $ queue_list ) ; $ map = [ ] ; // 队列 $ queue = $ request -> param ( 'queue' , '' ) ; if ( ! empty ( $ queue ) ) { $ map [ 'queue' ] = $ queue ; } $ this -> assign ( 'queue' , $ queue ) ; // 关键词 $ keyword = $ request -> param ( 'keyword' , '' ) ; if ( ! empty ( $ keyword ) ) { $ map [ 'payload' ] = [ 'exp' , 'like \'%' . str_replace ( [ '"' , '\\' ] , [ '' , '%' ] , json_encode ( $ keyword ) ) . '%\'' ] ; } $ this -> assign ( 'keyword' , $ keyword ) ; // 总数 $ total_count = $ job_logic -> model -> where ( $ map ) -> count ( ) ; $ this -> assign ( 'total_count' , $ total_count ) ; // 列表 $ list = $ job_logic -> model -> where ( $ map ) -> paginate ( $ this -> rows_num ) ; $ list_new = [ ] ; foreach ( $ list as $ vo ) { $ vo [ 'payload' ] = var_export ( json_decode ( $ vo [ 'payload' ] , true ) , true ) ; $ list_new [ ] = $ vo ; } $ this -> assign ( 'list' , $ list_new ) ; $ this -> assign ( 'page' , $ list -> render ( ) ) ; return $ this -> fetch ( ) ; }
任务列表

@param Request $request
@return string
任务列表