UserSchool.php 864 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\hander\HelpHander;
  5. use think\Db;
  6. class UserSchool extends Base
  7. {
  8. // 新增/编辑
  9. public function save(){
  10. model('UserSchool')->add();
  11. HelpHander::success([],'操作成功');
  12. }
  13. // 详情
  14. public function detail(){
  15. $id = input('id/d',0);
  16. $ret = model('UserSchool')->info($id);
  17. HelpHander::success($ret);
  18. }
  19. // 列表
  20. public function list(){
  21. $page = input('page/d',1);
  22. $size = input('size/d',10);
  23. $uid = input('uid/d',0);
  24. $ret = model('UserSchool')->lists($page,$size,$uid);
  25. HelpHander::success($ret);
  26. }
  27. // 删除
  28. public function del(){
  29. $id = input('id/d',0);
  30. model('UserSchool')->del($id);
  31. HelpHander::success([],'操作成功');
  32. }
  33. }