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');
+    }
 }