love_php/app/Models/Server/MerchantShareChannel.php

29 lines
614 B
PHP
Raw Permalink Normal View History

2026-04-02 09:20:51 +08:00
<?php
namespace App\Models\Server;
use App\Models\Live\Anchor;
use Illuminate\Database\Eloquent\Model;
class MerchantShareChannel extends Model
{
public function bindMerchantAnchor()
{
return $this->hasOne(Anchor::class, 'm_id', 'bind_m_id');
}
public function bindMerchantUser(){
return $this->hasOne(MerchantUser::class, 'id', 'bind_m_user_id');
}
public function orders()
{
return $this->hasMany(TouristOrder::class, 'share_channel_id', 'id');
}
public function paidOrders()
{
return $this->orders()->where('pay_status', 1);
}
}