AssetLeaseInfo.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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\BaseModel;
  19. use think\model\concern\SoftDelete;
  20. class AssetLeaseInfo extends BaseModel
  21. {
  22. use SoftDelete;
  23. protected $deleteTime = 'delete_time';
  24. /**
  25. * @notes 关联资产表
  26. * @return \think\model\relation\HasOne
  27. * @author 令狐冲
  28. * @date 2021/7/5 14:39
  29. */
  30. public function asset()
  31. {
  32. return $this->hasOne(AssetInfo::class, 'id', 'a_id')
  33. ->field('id,name,images,address,address,mobile,area');
  34. }
  35. /**
  36. * @notes 关联管理员表
  37. * @return \think\model\relation\HasOne
  38. * @author 令狐冲
  39. * @date 2021/7/5 14:39
  40. */
  41. public function referee()
  42. {
  43. return $this->hasOne(Admin::class, 'id', 'referee_uid')
  44. ->field('id,name');
  45. }
  46. /**
  47. * @notes 关联管理员表
  48. * @return \think\model\relation\HasOne
  49. * @author 令狐冲
  50. * @date 2021/7/5 14:39
  51. */
  52. public function first()
  53. {
  54. return $this->hasOne(Admin::class, 'id', 'first_uid')
  55. ->field('id,name');
  56. }
  57. /**
  58. * @notes 一审状态类型
  59. * @param $value
  60. * @param $data
  61. * @return string|string[]
  62. * @author ljj
  63. * @date 2022/2/17 2:50 下午
  64. */
  65. public function getFirstStatusDescAttr($value,$data)
  66. {
  67. return AssetEnum::getFirstStatusDesc($data['first_status']);
  68. }
  69. /**
  70. * @notes 终审
  71. * @param $value
  72. * @param $data second_status
  73. * @return string|string[]
  74. * @author ljj
  75. * @date 2022/2/17 2:50 下午
  76. */
  77. public function getSecondStatusDescAttr($value,$data)
  78. {
  79. return AssetEnum::getSecondStatusDesc($data['second_status']);
  80. }
  81. /**
  82. * @notes 终审
  83. * @param $value
  84. * @param $data second_status
  85. * @return string|string[]
  86. * @author ljj
  87. * @date 2022/2/17 2:50 下午
  88. */
  89. public function getApprovalStatusDescAttr($value,$data)
  90. {
  91. return AssetEnum::getApprovalStatusDesc($data['approval_status']);
  92. }
  93. }