作者 王智

xiugai

... ... @@ -30,9 +30,12 @@ class Car extends Backend
// $this->view->assign("statusList", $this->model->getStatusList());
$this->view->assign("ismenuList", $this->model->getIsmenuList());
$this->view->assign("typeList", $this->model->getTypeList());
$filter = $this->request->get("filter", '');
$filter = json_decode($filter, true);
$where = [];
if (!empty($filter['title'])) $where['title'] = ['LIKE', '%' . $filter['title'] . '%'];
// 必须将结果集转换为数组
$ruleList = collection($this->model->field('*,pid')->order('weigh', 'desc')->select())->toArray();
$ruleList = collection($this->model->field('*,pid')->where($where)->order('weigh', 'desc')->select())->toArray();
foreach ($ruleList as $k => &$v) {
$v['title'] = __($v['title']);
$v['remark'] = __($v['remark']);
... ... @@ -75,8 +78,6 @@ class Car extends Backend
if ($this->request->isAjax()) {
$list = $this->rulelist;
$total = count($this->rulelist);
dump($list);
die;
$result = array("total" => $total, "rows" => $list);
return json($result);
}
... ...