xiaogang 3 年之前
父節點
當前提交
03cd046893
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      app/Models/UserInfoModel.php

+ 4 - 0
app/Models/UserInfoModel.php

xqd
@@ -17,4 +17,8 @@ class UserInfoModel extends BaseModel
     public function getAgeAttribute(){
         return !empty($this->attributes['birthday'])?birthday($this->attributes['birthday']):0;
     }
+
+    public function user(){
+        return $this->hasOne(User::class,'user_id','id');
+    }
 }