DwbsUser.php 589 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Database\Eloquent\SoftDeletes;
  5. class DwbsUser extends Model
  6. {
  7. use SoftDeletes;
  8. protected $table='users';
  9. protected $connection='mysql_dwbs';
  10. public function warea()
  11. {
  12. return $this->belongsTo('App\Models\DwbsWarea','warea_id','id');
  13. }
  14. public function store()
  15. {
  16. return $this->belongsTo('App\Models\Store','id','user_id')->withTrashed();
  17. }
  18. public function GetWareaName()
  19. {
  20. return $this->belongsTo(DwbsWarea::class,'warea_id');
  21. }
  22. }