完全vue渲染列表的功能
去掉不必要的js函数定义 修改返回json的方式
This commit is contained in:
@@ -202,7 +202,7 @@ class OptionController extends DefaultController
|
||||
if (Request::method() == 'POST') {
|
||||
$rows = Option::where('parent_id', 0)->orderBy('sort', 'asc')->orderBy('id', 'asc')->get();
|
||||
$rows->prepend(['name' => '全部类别', 'id' => 0, 'parent_id' => 0]);
|
||||
return response()->json(['data' => $rows]);
|
||||
return ['data' => $rows];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ class RegionController extends DefaultController
|
||||
$row['text'] = $row['layer_space'].$row['name'];
|
||||
$json[] = $row;
|
||||
}
|
||||
return response()->json(['data' => $json]);
|
||||
return ['data' => $json];
|
||||
}
|
||||
return $this->render([
|
||||
'search' => $search,
|
||||
@@ -122,7 +122,7 @@ class RegionController extends DefaultController
|
||||
$model = Region::orderBy('id', 'asc');
|
||||
$rows = $model->get(['*', 'name as text']);
|
||||
array_nest($rows);
|
||||
return response()->json(['data' => $rows]);
|
||||
return ['data' => $rows];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user