MemberShuobo.php 870 B

12345678910111213141516171819202122232425262728293031323334353637
  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. 'education' => $this->education,
  25. 'school' => $this->school,
  26. 'pro' => $this->pro,
  27. 'address' => $this->address,
  28. 'trade_type' => $this->trade_type
  29. ];
  30. }
  31. }