框架学习

fastadmin public function index 不能显示数据到页面

由于需要显示多选的类目清单,需要自定义index 列表函数,但是却出现json数据能返回,但是却没有渲染到前端页面

页面仍然显示 “没有找到匹配的记录”

public function index(){

       $this->request->filter(['strip_tags','trim']);

       if($this->request->isAjax()){

           if($this->request->request('keyField')){

               return $this->selectpage();

           }

           list($where, $sort, $order, $offset, $limit) = $this->buildparams();

           $total = $this->model

                    ->where($where)

                    ->order($sort, $order)

                    ->count();

           

           $list = $this->model

                   ->where($where)

                   ->order($sort, $order)

                   ->limit($offset, $limit)

                   ->select();

           $list = collection($list)->toArray();

           $result = array('total' => $total, 'row' => $list);

           

           return json($result);

       }

       return  $this->view->fetch();

    }

rows少写了一个s,。。。。。无语,不过还好,耽误的时间不算太长