master
wangxinglong 2022-04-21 11:57:12 +08:00
parent 85c02fd2f3
commit 5dc6a1379f
1 changed files with 18 additions and 0 deletions

View File

@ -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();
}
}