webman_ad/app/model/CampaignBudget.php

44 lines
1.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace app\model;
use think\Model;
class CampaignBudget extends Model
{
// 设置当前模型对应的完整数据表名称
protected $table = 'public.bps_google_ads_budget';
// 设置主键
protected $pk = 'budget_id';
// 设置自动时间戳
protected $autoWriteTimestamp = true;
// 定义时间戳字段
protected $createTime = 'create_at';
protected $updateTime = 'update_at';
// 设置字段类型和默认值
protected $casts = [
'budget_id' => 'int',
'customer_id' => 'int',
'amount_micros' => 'int',
'start_date' => 'date',
'end_date' => 'date',
];
// 默认值设置
protected $defaults = [
'amount_micros' => 0, // 预算金额默认0
];
// 关联 Customer 模型(预算与客户相关)
// public function customer()
// {
// return $this->belongsTo(GoogleAdsCustomer::class, 'customer_id', 'customer_id');
// }
// 可以根据需要添加其他关联方法假设有其他与预算相关的表例如广告系列campaign
}