AssetLeaseController.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\adminapi\controller\asset;
  15. use app\adminapi\controller\BaseAdminController;
  16. use app\adminapi\lists\asset\AssetLists;
  17. use app\adminapi\lists\asset\AssetLeaseLists;
  18. use app\adminapi\logic\notice\NoticeLogic;
  19. use app\adminapi\validate\article\ArticleValidate;
  20. use app\adminapi\validate\asset\AssetValidate;
  21. use app\common\enum\asset\AssetEnum;
  22. use app\adminapi\validate\asset\AssetLeaseValidate;
  23. use app\adminapi\validate\notice\NoticeValidate;
  24. use app\common\logic\PaymentLogic;
  25. /**
  26. * 资产租赁控制器
  27. * Class NoticeController
  28. * @package app\adminapi\controller\notice
  29. */
  30. class AssetLeaseController extends BaseAdminController
  31. {
  32. /**
  33. * @notes 查看资产列表
  34. * @return \think\response\Json
  35. * @author 段誉
  36. * @date 2021/12/29 9:55
  37. */
  38. public function lists()
  39. {
  40. return $this->dataLists(new AssetLeaseLists());
  41. }
  42. /**
  43. * @notes 添加资产
  44. * @return \think\response\Json
  45. * @author heshihu
  46. * @date 2022/2/22 9:57
  47. */
  48. public function add()
  49. {
  50. $params = (new AssetLeaseValidate())->post()->goCheck('add');
  51. $params['referee_uid'] =$this->adminId;
  52. $result =AssetLeaseLists::add($params);
  53. if ($result['code'] <> 200) {
  54. return $this->fail($result['msg']);
  55. }
  56. return $this->success($result['msg'], [], 1, 1);
  57. }
  58. /**
  59. * @notes 编辑资产
  60. * @return \think\response\Json
  61. * @author heshihu
  62. * @date 2022/2/22 10:12
  63. */
  64. public function edit()
  65. {
  66. $params = (new AssetLeaseValidate())->post()->goCheck('edit');
  67. $params['referee_uid'] =$this->adminId;
  68. $result = AssetLeaseLists::edit($params);
  69. if (true === $result) {
  70. return $this->success('编辑成功', [], 1, 1);
  71. }
  72. return $this->fail(AssetLeaseLists::getError());
  73. }
  74. /**
  75. * @notes 租赁详情
  76. * @return \think\response\Json
  77. * @author heshihu
  78. * @date 2022/2/22 10:15
  79. */
  80. public function detail()
  81. {
  82. $params = (new AssetLeaseValidate())->goCheck('detail');
  83. $result = AssetLeaseLists::detail($params);
  84. return $this->data($result);
  85. }
  86. /**
  87. * @notes 获取可租赁房产
  88. * @return \think\response\Json
  89. * @author 段誉
  90. * @date 2022/3/29 11:18
  91. */
  92. public function getAssetForRent()
  93. {
  94. $params = $this->request->get();
  95. $result = AssetLists::getRentAssetList($params);
  96. return $this->success('查询成功', $result, 1, 1);
  97. }
  98. public function getApprovalSattusDesc(){
  99. $list = AssetEnum::APPROVAL_STATUS_SCENE;
  100. $lists =[ ['id'=>0,'status_desc'=>'全部']];
  101. $lists = array_merge($lists,$list);
  102. return $this->success('查询成功',$lists, 1, 1);
  103. }
  104. public function doApprove(){
  105. $params = (new AssetLeaseValidate())->post()->goCheck('approve');
  106. $params['approve_uid'] =$this->adminId;
  107. $result = AssetLeaseLists::approve($params);
  108. if (true === $result) {
  109. return $this->success('审核完成!', [], 1, 1);
  110. }
  111. return $this->fail(AssetLeaseLists::getError());
  112. }
  113. }