| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <?php
- // +----------------------------------------------------------------------
- // | likeadmin快速开发前后端分离管理后台(PHP版)
- // +----------------------------------------------------------------------
- // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
- // | 开源版本可自由商用,可去除界面版权logo
- // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
- // | github下载:https://github.com/likeshop-github/likeadmin
- // | 访问官网:https://www.likeadmin.cn
- // | likeadmin团队 版权所有 拥有最终解释权
- // +----------------------------------------------------------------------
- // | author: likeadminTeam
- // +----------------------------------------------------------------------
- namespace app\adminapi\controller\asset;
- use app\adminapi\controller\BaseAdminController;
- use app\adminapi\lists\asset\AssetLists;
- use app\adminapi\lists\asset\AssetLeaseLists;
- use app\adminapi\logic\notice\NoticeLogic;
- use app\adminapi\validate\article\ArticleValidate;
- use app\adminapi\validate\asset\AssetValidate;
- use app\common\enum\asset\AssetEnum;
- use app\adminapi\validate\asset\AssetLeaseValidate;
- use app\adminapi\validate\notice\NoticeValidate;
- use app\common\logic\PaymentLogic;
- /**
- * 资产租赁控制器
- * Class NoticeController
- * @package app\adminapi\controller\notice
- */
- class AssetLeaseController extends BaseAdminController
- {
- public array $notNeedLogin = ['autoUpdataLeaseStatus'];
- /**
- * @notes 查看资产列表
- * @return \think\response\Json
- * @author 段誉
- * @date 2021/12/29 9:55
- */
- public function lists()
- {
- return $this->dataLists(new AssetLeaseLists());
- }
- /**
- * @notes 添加资产
- * @return \think\response\Json
- * @author heshihu
- * @date 2022/2/22 9:57
- */
- public function add()
- {
- $params = (new AssetLeaseValidate())->post()->goCheck('add');
- $params['referee_uid'] =$this->adminId;
- $result =AssetLeaseLists::add($params);
- if ($result['code'] <> 200) {
- return $this->fail($result['msg']);
- }
- return $this->success($result['msg'], [], 1, 1);
- }
- /**
- * @notes 编辑资产
- * @return \think\response\Json
- * @author heshihu
- * @date 2022/2/22 10:12
- */
- public function edit()
- {
- $params = (new AssetLeaseValidate())->post()->goCheck('edit');
- $params['referee_uid'] =$this->adminId;
- $result = AssetLeaseLists::edit($params);
- if (true === $result) {
- return $this->success('编辑成功', [], 1, 1);
- }
- return $this->fail(AssetLeaseLists::getError());
- }
- /**
- * @notes 租赁详情
- * @return \think\response\Json
- * @author heshihu
- * @date 2022/2/22 10:15
- */
- public function detail()
- {
- $params = (new AssetLeaseValidate())->goCheck('detail');
- $result = AssetLeaseLists::detail($params);
- return $this->data($result);
- }
- /**
- * @notes 获取可租赁房产
- * @return \think\response\Json
- * @author 段誉
- * @date 2022/3/29 11:18
- */
- public function getAssetForRent()
- {
- $params = $this->request->get();
- $result = AssetLists::getRentAssetList($params);
- return $this->success('查询成功', $result, 1, 1);
- }
- public function getApprovalSattusDesc(){
- $list = AssetEnum::APPROVAL_STATUS_SCENE;
- $params = $this->request->get();
- if(isset($params['flag'])){
- if($params['flag']){
- $lists =[ ['id'=>0,'status_desc'=>'全部']];
- $list = array_merge($lists,$list);
- }
- }
- return $this->success('查询成功',$list, 1, 1);
- }
- public function doApprove(){
- $params = (new AssetLeaseValidate())->post()->goCheck('approve');
- $params['approve_uid'] =$this->adminId;
- $result = AssetLeaseLists::approve($params);
- if (true === $result) {
- return $this->success('审核完成!', [], 1, 1);
- }
- return $this->fail(AssetLeaseLists::getError());
- }
- public function autoUpdataLeaseStatus(){
- $result = AssetLeaseLists::autoUpdateStatus();
- return $this->success('更新成功',[], 1, 1);
- }
- public function setEnd(){
- $params = (new AssetLeaseValidate())->post()->goCheck('end');
- $params['approve_uid'] =$this->adminId;
- $result = AssetLeaseLists::setEnd($params);
- if (true === $result) {
- return $this->success('终止成功', [], 1, 1);
- }
- return $this->fail(AssetLeaseLists::getError());
- }
- }
|