<?php

namespace app\common\model;

use support\think\Model;

/**
 * Channel
 */
class Channel extends Model
{
    // 表名
    protected $name = 'channel';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = true;

    // 字段类型转换
    protected $type = [
        'create_time' => 'integer',
        'update_time' => 'integer',
        'affiliate_effective_start_at' => 'integer',
        'affiliate_effective_end_at' => 'integer',
        'settle_weekday' => 'integer',
        'settle_monthday' => 'integer',
    ];

    public function getprofitAmountAttr($value): ?float
    {
        return is_null($value) ? null : (float)$value;
    }
}
