1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?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('App\Models\MemberUser', 'user_id');
- }
- /**
- * @Author FelixYin
- *
- * @description 店铺关联认证信息
- */
- public function auth()
- {
- return $this->hasOne('App\Models\ShopAuthRecord', 'id', 'auth_record_id');
- }
- /**
- * @Author FelixYin
- *
- * @description 店铺关联技师
- */
- public function coaches()
- {
- return $this->hasMany('App\Models\CoachUser', 'shop_id', 'id');
- }
- /**
- * @Author FelixYin
- *
- * @description 店铺关联服务
- */
- public function services()
- {
- return $this->hasMany('App\Models\ShopService', 'shop_id', 'id');
- }
- /**
- * @Author FelixYin
- *
- * @description 店铺关联认证记录
- */
- public function authRecords()
- {
- return $this->hasMany('App\Models\ShopAuthRecord', 'shop_id', 'id');
- }
- /**
- * 获取店铺认证记录
- */
- public function authRecord()
- {
- return $this->belongsTo(ShopAuthRecord::class, 'auth_record_id');
- }
- }
|