<?php

namespace App\Models\goods\mysql;

use Api\PhpUtils\Mysql\MysqlBase;

/**
 * Class Shop
 * 店铺
 * @package App\Models\goods\mysql
 */
class Shop extends MysqlBase
{
    const TABLE_NAME = 'shop';
    const CONFIG_INDEX = 'goods';

    const STATUS_ONLINE = 1;// 上线
    const STATUS_OFFLINE = 2;// 下线

    public static function getRecord($where, $columns = [])
    {
        if (empty($columns)) {
            $columns = '*';
        }
        return self::get($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);
    }
}