UserSalary.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 UserSalary extends Base
  7. {
  8. // 新增
  9. public function save(){
  10. model('UserSalary')->add();
  11. HelpHander::success([],'操作成功');
  12. }
  13. // 编辑
  14. public function update(){
  15. model('UserSalary')->add();
  16. HelpHander::success([],'操作成功');
  17. }
  18. // 详情
  19. public function detail(){
  20. $id = input('id/d',0);
  21. $ret = model('UserSalary')->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. $status = input('status/d',-1);
  31. $companyId = input('companyId/d',0);
  32. $ret = model('UserSalary')->lists($page,$size,$this->orgId,$name,$phone,$status,$companyId);
  33. HelpHander::success($ret);
  34. }
  35. // 修改状态
  36. public function updateStatus(){
  37. $id = input('id/d',0);
  38. $enable = input('status/d',0);
  39. model('UserSalary')->changeStatus($id,$enable);
  40. HelpHander::success([],'操作成功');
  41. }
  42. // 删除
  43. public function del(){
  44. $id = input('id/d',0);
  45. model('UserSalary')->del($id);
  46. HelpHander::success([],'操作成功');
  47. }
  48. }