<?php

namespace App\Models\marketing\mysql;

use Api\PhpUtils\Mysql\MysqlBase;

class MarketingPindan extends MysqlBase
{
    const TABLE_NAME = 'marketing_pindan';
    const CONFIG_INDEX = 'marketing';
    const PRIMARY_KEY = 'marketing_pindan_id';

    const ACTIVITY_STATUS_NO_START = 1;
    const ACTIVITY_STATUS_IN_PROGRESS = 2;
    const ACTIVITY_STATUS_FINISHED = 3;
    const ACTIVITY_STATUS_START_TODAY = 4;//今日上新

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

    public static function insertRecord($colums)
    {
        return self::insert($colums);
    }

    public static function updateRecord($colums, $where)
    {
        return self::update($colums, $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);
    }
}
