<?php


namespace App\Models\shop\mysql;


use Api\PhpUtils\Mysql\MysqlBase;

class SubShop extends MysqlBase
{
    const TABLE_NAME = 'sub_shop';
    const CONFIG_INDEX = 'goods';
    const PRIMARY_KEY = 'sub_shop_id';
 

    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)
    {
        $options['rowCount'] = true;
        return self::insert($colums,$options);
    }

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

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

    public static function getCount($where, $columns = "*")
    {
        return self::count($columns, $where);
    }
}
