UserCert.php 620 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use App\Models\User;
  5. class UserCert extends Model{
  6. protected $table = 'user_cert';
  7. public $timestamps=true;
  8. /*
  9. * 邀请人关联
  10. * */
  11. public function recom_user()
  12. {
  13. return $this->belongsTo(User::class,'recom_id');
  14. }
  15. /*
  16. * 用户信息
  17. * */
  18. public function user_info()
  19. {
  20. return $this->belongsTo(User::class,'user_id');
  21. }
  22. /*
  23. *上级关联
  24. *
  25. * */
  26. public function agent_user()
  27. {
  28. return $this->belongsTo(User::class,'agent_id');
  29. }
  30. }