| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?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\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,address,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 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']);
- }
- }
|