<?php

namespace App\Models\marketing\mysql;

use Api\PhpUtils\Mysql\MysqlBase;

class Tag extends MysqlBase
{
    const TABLE_NAME = 'tag';
    const CONFIG_INDEX = 'marketing';
    const PRIMARY_KEY = 'tag_id';

    const STATUS_IS_DEL_NO = 0;
    const STATUS_IS_DEL_YES = 1;

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

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

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

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

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