<?php

namespace app\model;

use think\Model;

class Campaign extends PgBaseModel
{
    protected $table = 'ad_ga_campaigns';  // 对应数据库表名
    protected $primaryKey = 'id';       // 主键
    protected $autoWriteTimestamp = true; // 自动时间戳
    protected $createTime = 'created_at'; // 创建时间字段
    protected $updateTime = 'updated_at'; // 更新时间字段

    // 关联广告预算
    public function campaignBudget()
    {
        return $this->belongsTo(CampaignBudget::class, 'budget_id', 'id');
    }
}