<?php

namespace app\model;

use app\BaseModel;
use think\model\concern\SoftDelete;
use think\model\relation\HasMany;
use think\model\relation\HasOne;

class XmChannel extends BaseModel
{
    use SoftDelete;

    protected $name = "xm_channel";
    protected $pk = "channel_id";

    /**
     * 会员所属平台
     */
    public function platform(): HasOne
    {
        return $this->hasOne(XmPlatform::class,'platform_id','platform_id');
    }
    /**
     * 渠道下的会员列表
     * @return HasMany
     */
    public function members(): HasMany
    {
        return $this->hasMany(XmMember::class);
    }
}