<?php

namespace App\Models\marketing\mysql;

use Api\PhpUtils\Mysql\MysqlBase;

class ColonelDistributorConfig extends MysqlBase
{
    const TABLE_NAME = 'colonel_distributor_colonel_config';
    const CONFIG_INDEX = 'marketing';
    const PRIMARY_KEY = 'colonel_config_id';

    const TYPE_COLONEL = 1;//团长分销活动

    public static function getRecord($where, $columns = [], $options = [])
    {
        if (empty($columns)) {
            $columns = '*';
        }
        return self::get($columns, $where, $options);
    }

    public static function getRecordMaster($where, $columns = [], $options = [])
    {
        if (empty($columns)) {
            $columns = '*';
        }
        return self::selectMaster($columns, $where, $options);
    }

    public static function insertRecord($columns, $options = [])
    {
        return self::insert($columns, $options);
    }

    public static function updateRecord($columns, $where)
    {
        return self::update($columns, $where);
    }

    public static function save($data, $where = [], $options = [])
    {
        if (empty($where)) {
            return self::insert($data, $options);
        }
        return self::update($data, $where);
    }

    public static function deleteRecord($where)
    {
        return self::delete($where);
    }
}