UserLabor.php 1.6 KB

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