AssetLeaseInfo.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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\common\model\asset;
  15. use app\common\enum\DefaultEnum;
  16. use app\common\enum\asset\AssetEnum;
  17. use app\common\model\auth\Admin;
  18. use app\common\model\asset\AssetInfo;
  19. use app\common\model\BaseModel;
  20. use think\model\concern\SoftDelete;
  21. class AssetLeaseInfo extends BaseModel
  22. {
  23. use SoftDelete;
  24. protected $deleteTime = 'delete_time';
  25. /**
  26. * @notes 关联资产表
  27. * @return \think\model\relation\HasOne
  28. * @author 令狐冲
  29. * @date 2021/7/5 14:39
  30. */
  31. public function asset()
  32. {
  33. return $this->hasOne(AssetInfo::class, 'id', 'a_id')
  34. ->field('id,name,images,address,contacts,mobile,area');
  35. }
  36. /**
  37. * @notes 关联管理员表
  38. * @return \think\model\relation\HasOne
  39. * @author 令狐冲
  40. * @date 2021/7/5 14:39
  41. */
  42. public function referee()
  43. {
  44. return $this->hasOne(Admin::class, 'id', 'referee_uid')
  45. ->field('id,name');
  46. }
  47. /**
  48. * @notes 关联管理员表
  49. * @return \think\model\relation\HasOne
  50. * @author 令狐冲
  51. * @date 2021/7/5 14:39
  52. */
  53. public function firstapproval()
  54. {
  55. return $this->hasOne(Admin::class, 'id', 'first_uid')
  56. ->field('id,name');
  57. }
  58. /**
  59. * @notes 关联管理员表
  60. * @return \think\model\relation\HasOne
  61. * @author 令狐冲
  62. * @date 2021/7/5 14:39
  63. */
  64. public function endapproval()
  65. {
  66. return $this->hasOne(Admin::class, 'id', 'second_uid')
  67. ->field('id,name');
  68. }
  69. /**
  70. * @notes 关联管理员表
  71. * @return \think\model\relation\HasOne
  72. * @author 令狐冲
  73. * @date 2021/7/5 14:39
  74. */
  75. public function first()
  76. {
  77. return $this->hasOne(Admin::class, 'id', 'first_uid')
  78. ->field('id,name');
  79. }
  80. /**
  81. * @notes 一审状态类型
  82. * @param $value
  83. * @param $data
  84. * @return string|string[]
  85. * @author ljj
  86. * @date 2022/2/17 2:50 下午
  87. */
  88. public function getFirstStatusDescAttr($value,$data)
  89. {
  90. return AssetEnum::getFirstStatusDesc($data['first_status']);
  91. }
  92. /**
  93. * @notes 终审
  94. * @param $value
  95. * @param $data second_status
  96. * @return string|string[]
  97. * @author ljj
  98. * @date 2022/2/17 2:50 下午
  99. */
  100. public function getSecondStatusDescAttr($value,$data)
  101. {
  102. return AssetEnum::getSecondStatusDesc($data['second_status']);
  103. }
  104. /**
  105. * @notes 终审
  106. * @param $value
  107. * @param $data second_status
  108. * @return string|string[]
  109. * @author ljj
  110. * @date 2022/2/17 2:50 下午
  111. */
  112. public function getApprovalStatusDescAttr($value,$data)
  113. {
  114. return AssetEnum::getApprovalStatusDesc($data['approval_status']);
  115. }
  116. /**
  117. * @notes 是否缴费
  118. * @param $value
  119. * @param $data second_status
  120. * @return string|string[]
  121. * @author ljj
  122. * @date 2022/2/17 2:50 下午
  123. */
  124. public function getIsPayDescAttr($value,$data)
  125. {
  126. return AssetEnum::getIsPayDesc($data['is_pay']);
  127. }
  128. }