setter
parent
85c02fd2f3
commit
5dc6a1379f
|
@ -76,4 +76,22 @@ class Area extends Base
|
|||
return $this->json(4000, '非法请求');
|
||||
}
|
||||
|
||||
/**
|
||||
* 排序
|
||||
* @return Json
|
||||
*/
|
||||
public function sort()
|
||||
{
|
||||
if (!$this->request->isPost()) {
|
||||
return $this->json(4000, '非法请求');
|
||||
}
|
||||
$id = $this->request->param('id/d', 0);
|
||||
$sort = $this->request->param('sort/d', 0);
|
||||
if (!$info = AreaModel::findById($id)) {
|
||||
return $this->json(4001, '记录不存在');
|
||||
}
|
||||
$info->save(["sort"=>$sort]);
|
||||
return $this->json();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue