UserRetired.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 UserRetired extends Base
  7. {
  8. // 新增
  9. public function save(){
  10. model('UserRetired')->add();
  11. HelpHander::success([],'操作成功');
  12. }
  13. // 编辑
  14. public function update(){
  15. model('UserRetired')->add();
  16. HelpHander::success([],'操作成功');
  17. }
  18. // 详情
  19. public function detail(){
  20. $id = input('id/d',0);
  21. $ret = model('UserRetired')->info($id);
  22. HelpHander::success($ret);
  23. }
  24. // 列表
  25. public function list(){
  26. $page = input('page/d',1);
  27. $size = input('size/d',10);
  28. $name = input('name','','trim');
  29. $phone = input('phone','','trim');
  30. $ret = model('UserRetired')->lists($page,$size,$this->orgId,$name,$phone);
  31. HelpHander::success($ret);
  32. }
  33. // 修改状态
  34. public function updateStatus(){
  35. $id = input('id/d',0);
  36. $enable = input('status/d',0);
  37. model('UserRetired')->changeStatus($id,$enable);
  38. HelpHander::success([],'操作成功');
  39. }
  40. // 获取退休人员列表,去除已经加入到工资表中的人员
  41. public function retiredUser(){
  42. $page = input('page/d',1);
  43. $size = input('size/d',10);
  44. $name = input('name','','trim');
  45. $phone = input('phone','','trim');
  46. $ret = model('UserRetired')->retiredUser($page,$size,$name,$phone,$this->orgId);
  47. HelpHander::success($ret);
  48. }
  49. // 删除
  50. public function del(){
  51. $id = input('id/d',0);
  52. model('UserRetired')->del($id);
  53. HelpHander::success([],'操作成功');
  54. }
  55. }