<?php

namespace App\Models\marketing\mysql;

use Api\PhpUtils\Mysql\MysqlBase;

class ColonelDistributorInviteOrderNum extends MysqlBase
{
    const TABLE_NAME = 'colonel_distributor_invite_order_num';
    const CONFIG_INDEX = 'marketing';
    const PRIMARY_KEY = 'invite_order_num_id';

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

    public static function getRecords(array $where, $column = '*')
    {
        return (array)self::select($column, $where);
    }

    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);
    }
}
