MemberShuobo.php 903 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 $this->toArray();
  22. return [
  23. 'realname' => $this->realname,
  24. 'mobile' => $this->mobile,
  25. 'education' => $this->education,
  26. 'school' => $this->school,
  27. 'pro' => $this->pro,
  28. 'address' => $this->address,
  29. 'trade_type' => $this->trade_type
  30. ];
  31. }
  32. }