MemberShuobo.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace App\Models;
  3. use App\Search\Traits\ShuoboSearchable;
  4. use Illuminate\Database\Eloquent\SoftDeletes;
  5. use Illuminate\Database\Eloquent\Model;
  6. class MemberShuobo extends Model
  7. {
  8. use SoftDeletes,ShuoboSearchable;
  9. protected $table = 'members_shuobo';
  10. protected $guarded = [];
  11. public function resumes()
  12. {
  13. return $this->hasMany(Resume::class, 'uid', 'uid');
  14. }
  15. public function members()
  16. {
  17. return $this->belongsTo(Member::class, 'uid');
  18. }
  19. public function toSearchableArray()
  20. {
  21. return [
  22. 'realname' => $this->realname,
  23. 'mobile' => $this->mobile,
  24. 'email' => $this->email,
  25. 'education' => $this->education,
  26. 'school' => $this->school,
  27. 'pro' => $this->pro,
  28. 'address' => $this->address,
  29. 'country' => $this->country,
  30. 'company' => $this->company,
  31. 'job' => $this->job,
  32. 'trade_type' => $this->trade_type,
  33. 'speciality' => $this->speciality
  34. ];
  35. }
  36. }