AssetLeaseInfo.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 first()
  54. {
  55. return $this->hasOne(Admin::class, 'id', 'first_uid')
  56. ->field('id,name');
  57. }
  58. /**
  59. * @notes 一审状态类型
  60. * @param $value
  61. * @param $data
  62. * @return string|string[]
  63. * @author ljj
  64. * @date 2022/2/17 2:50 下午
  65. */
  66. public function getFirstStatusDescAttr($value,$data)
  67. {
  68. return AssetEnum::getFirstStatusDesc($data['first_status']);
  69. }
  70. /**
  71. * @notes 终审
  72. * @param $value
  73. * @param $data second_status
  74. * @return string|string[]
  75. * @author ljj
  76. * @date 2022/2/17 2:50 下午
  77. */
  78. public function getSecondStatusDescAttr($value,$data)
  79. {
  80. return AssetEnum::getSecondStatusDesc($data['second_status']);
  81. }
  82. /**
  83. * @notes 终审
  84. * @param $value
  85. * @param $data second_status
  86. * @return string|string[]
  87. * @author ljj
  88. * @date 2022/2/17 2:50 下午
  89. */
  90. public function getApprovalStatusDescAttr($value,$data)
  91. {
  92. return AssetEnum::getApprovalStatusDesc($data['approval_status']);
  93. }
  94. }