> ` input('post.sort/a') 对应前台传过来的值name="sort[{$item.id}]";`
> `注明此处的sort不是数据库里的字段;`
```
public function sort(){
if($this->request->isPost()) {
foreach (input('post.sort/a') as $k => $v) {
\db('category')->where('id', $k)->update(['sort_id' => $v]);
}
return $this->success();
}
}
```