ShopInfo.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\SoftDeletes;
  4. use Slowlyo\OwlAdmin\Models\BaseModel as Model;
  5. /**
  6. * 店铺
  7. */
  8. class ShopInfo extends Model
  9. {
  10. use SoftDeletes;
  11. protected $table = 'shop_infos';
  12. /**
  13. * @Author FelixYin
  14. *
  15. * @description 店铺所属会员
  16. */
  17. public function member()
  18. {
  19. return $this->belongsTo('App\Models\MemberUser', 'user_id');
  20. }
  21. /**
  22. * @Author FelixYin
  23. *
  24. * @description 店铺关联认证信息
  25. */
  26. public function auth()
  27. {
  28. return $this->hasOne('App\Models\ShopAuthRecord', 'id', 'auth_record_id');
  29. }
  30. /**
  31. * @Author FelixYin
  32. *
  33. * @description 店铺关联技师
  34. */
  35. public function coaches()
  36. {
  37. return $this->hasMany('App\Models\CoachUser', 'shop_id', 'id');
  38. }
  39. /**
  40. * @Author FelixYin
  41. *
  42. * @description 店铺关联服务
  43. */
  44. public function services()
  45. {
  46. return $this->hasMany('App\Models\ShopService', 'shop_id', 'id');
  47. }
  48. /**
  49. * @Author FelixYin
  50. *
  51. * @description 店铺关联认证记录
  52. */
  53. public function authRecords()
  54. {
  55. return $this->hasMany('App\Models\ShopAuthRecord', 'shop_id', 'id');
  56. }
  57. /**
  58. * 获取店铺认证记录
  59. */
  60. public function authRecord()
  61. {
  62. return $this->belongsTo(ShopAuthRecord::class, 'auth_record_id');
  63. }
  64. }