<?php

namespace App\Models\user\mysql;

use Api\PhpUtils\Mysql\MysqlBase;

/**
 * Class Shop
 * 用户微信绑定
 * @package App\Models\goods\mysql
 */
class UserWechatBind extends MysqlBase
{
    const TABLE_NAME = 'user_wechat_bind';
    const CONFIG_INDEX = 'marketing';
    const PRIMARY_KEY = 'wechat_id';

    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::getMaster($columns, $where);
    }

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

    public static function getRecordsMaster ($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);
    }
}