HouseContract.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 HouseContract extends Base
  7. {
  8. // 新增
  9. public function save(){
  10. model('HouseContract')->add();
  11. HelpHander::success([],'操作成功');
  12. }
  13. // 删除
  14. public function del(){
  15. $id = input('id/d',0);
  16. model('HouseContract')->del($id);
  17. HelpHander::success([],'操作成功');
  18. }
  19. //列表
  20. public function list(){
  21. $page = input('page/d',1);
  22. $size = input('size/d',10);
  23. $intro = input('intro','','trim');
  24. $sn = input('sn','','trim');
  25. $lessee = input('lessee','','trim');
  26. $status = input('status','','trim');
  27. $ret = model('HouseContract')->lists($page,$size,$intro,$sn,$lessee,$status,$this->userId,$this->orgId);
  28. HelpHander::success($ret);
  29. }
  30. //未完善合同列表
  31. public function list2(){
  32. $page = input('page/d',1);
  33. $size = input('size/d',10);
  34. $intro = input('intro','','trim');
  35. $sn = input('sn','','trim');
  36. $status = input('status','','trim');
  37. $ret = model('HouseContract')->lists2($page,$size,$intro,$sn,$status,$this->userId,$this->orgId);
  38. HelpHander::success($ret);
  39. }
  40. //详情
  41. public function detail(){
  42. $id = input('id/d',0);
  43. $ret = model('HouseContract')->info($id);
  44. HelpHander::success($ret);
  45. }
  46. //承租房屋列表
  47. public function house(){
  48. $id = input('id/d',0);
  49. $ret = model('HouseContract')->house($id);
  50. HelpHander::success($ret);
  51. }
  52. // 终止合同
  53. public function stop(){
  54. $id = input('id/d',0);
  55. model('HouseContract')->stop($id);
  56. HelpHander::success([],'操作成功');
  57. }
  58. //列表
  59. public function listByHouse(){
  60. $page = input('page/d',1);
  61. $size = input('size/d',10);
  62. $houseId = input('houseId/d','','trim');
  63. $ret = model('HouseContract')->listByHouse($page,$size,$houseId,$this->userId,$this->orgId);
  64. HelpHander::success($ret);
  65. }
  66. }