123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\SoftDeletes;
- use Slowlyo\OwlAdmin\Models\BaseModel as Model;
- /**
- * 店铺
- */
- class ShopInfo extends Model
- {
- use SoftDeletes;
- protected $table = 'shop_infos';
- /**
- * @Author FelixYin
- * @description 店铺所属会员
- */
- public function member()
- {
- return $this->belongsTo(MemberUser::class, 'user_id', 'id');
- }
- /**
- * @Author FelixYin
- * @description 店铺关联认证信息
- */
- public function auth()
- {
- return $this->hasOne(ShopAuthRecord::class, 'id', 'auth_record_id');
- }
- /**
- * @Author FelixYin
- * @description 店铺关联技师
- */
- public function coaches()
- {
- return $this->hasMany(CoachUser::class, 'shop_id', 'id');
- }
- /**
- * @Author FelixYin
- * @description 店铺关联服务
- */
- public function services()
- {
- return $this->hasMany(ShopService::class, 'shop_id', 'id');
- }
- /**
- * @Author FelixYin
- * @description 店铺关联认证记录
- */
- public function authRecords()
- {
- return $this->hasMany(ShopAuthRecord::class, 'shop_id', 'id');
- }
- /**
- * 获取店铺认证记录
- */
- public function authRecord()
- {
- return $this->belongsTo(ShopAuthRecord::class, 'auth_record_id');
- }
- }
|