| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <?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\common\model\asset;
- use app\common\enum\DefaultEnum;
- use app\common\enum\asset\AssetEnum;
- use app\common\model\auth\Admin;
- use app\common\model\asset\AssetInfo;
- use app\common\model\BaseModel;
- use think\model\concern\SoftDelete;
- class AssetLeaseInfo extends BaseModel
- {
- use SoftDelete;
- protected $deleteTime = 'delete_time';
- /**
- * @notes 关联资产表
- * @return \think\model\relation\HasOne
- * @author 令狐冲
- * @date 2021/7/5 14:39
- */
- public function asset()
- {
- return $this->hasOne(AssetInfo::class, 'id', 'a_id')
- ->field('id,name,images,address,contacts,mobile,area');
- }
- /**
- * @notes 关联管理员表
- * @return \think\model\relation\HasOne
- * @author 令狐冲
- * @date 2021/7/5 14:39
- */
- public function referee()
- {
- return $this->hasOne(Admin::class, 'id', 'referee_uid')
- ->field('id,name');
- }
- /**
- * @notes 关联管理员表
- * @return \think\model\relation\HasOne
- * @author 令狐冲
- * @date 2021/7/5 14:39
- */
- public function firstapproval()
- {
- return $this->hasOne(Admin::class, 'id', 'first_uid')
- ->field('id,name');
- }
- /**
- * @notes 关联管理员表
- * @return \think\model\relation\HasOne
- * @author 令狐冲
- * @date 2021/7/5 14:39
- */
- public function endapproval()
- {
- return $this->hasOne(Admin::class, 'id', 'second_uid')
- ->field('id,name');
- }
- /**
- * @notes 关联管理员表
- * @return \think\model\relation\HasOne
- * @author 令狐冲
- * @date 2021/7/5 14:39
- */
- public function first()
- {
- return $this->hasOne(Admin::class, 'id', 'first_uid')
- ->field('id,name');
- }
- /**
- * @notes 一审状态类型
- * @param $value
- * @param $data
- * @return string|string[]
- * @author ljj
- * @date 2022/2/17 2:50 下午
- */
- public function getFirstStatusDescAttr($value,$data)
- {
- return AssetEnum::getFirstStatusDesc($data['first_status']);
- }
- /**
- * @notes 终审
- * @param $value
- * @param $data second_status
- * @return string|string[]
- * @author ljj
- * @date 2022/2/17 2:50 下午
- */
- public function getSecondStatusDescAttr($value,$data)
- {
- return AssetEnum::getSecondStatusDesc($data['second_status']);
- }
- /**
- * @notes 终审
- * @param $value
- * @param $data second_status
- * @return string|string[]
- * @author ljj
- * @date 2022/2/17 2:50 下午
- */
- public function getApprovalStatusDescAttr($value,$data)
- {
- return AssetEnum::getApprovalStatusDesc($data['approval_status']);
- }
- /**
- * @notes 是否缴费
- * @param $value
- * @param $data second_status
- * @return string|string[]
- * @author ljj
- * @date 2022/2/17 2:50 下午
- */
- public function getIsPayDescAttr($value,$data)
- {
- return AssetEnum::getIsPayDesc($data['is_pay']);
- }
- }
|