UserBase.php 975 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 UserBase extends Base
  7. {
  8. // 新增
  9. public function save(){
  10. model('UserBase')->add();
  11. HelpHander::success([],'操作成功');
  12. }
  13. // 详情
  14. public function detail(){
  15. $id = input('id/d',0);
  16. $ret = model('UserBase')->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. $name = input('name','','trim');
  24. $phone = input('phone','','trim');
  25. $companyId = input('companyId/d',0);
  26. $ret = model('UserBase')->lists($page,$size,$name,$phone,$companyId,$this->orgId);
  27. HelpHander::success($ret);
  28. }
  29. // 删除
  30. public function del(){
  31. $id = input('id/d',0);
  32. model('UserBase')->del($id);
  33. HelpHander::success([],'操作成功');
  34. }
  35. }