12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace app\common\model;
- use app\common\constant\CommonConstant;
- use think\Model;
- /**
- * 审批模型
- */
- class Approve extends Model
- {
- // 表名
- protected $name = 'approve';
- // 关联用户
- public function user()
- {
- return $this->belongsTo(User::class, 'approve_user', 'userid')->where('is_deleted',CommonConstant::IS_DELETED_0);
- }
- // 关联审批申请 join
- public function approveInfo()
- {
- return $this->belongsTo(ApproveInfo::class, 'info_id', 'id');
- }
- public function approveInfoUser()
- {
- return $this->belongsTo(User::class, 'approve_info.user_id', 'userid');
- }
- }
|