<?php

namespace App\Models\goods\mysql;

use Api\PhpUtils\Mysql\MysqlBase;

/**
 * Class GoodsRefundRecord
 * 商品退款记录
 * @package App\Models\goods\mysql
 */
class GoodsRefundRecord extends MysqlBase
{
    const TABLE_NAME = 'goods_refund_record';
    const CONFIG_INDEX = 'goods';

    const OPERATOR_RESULT_FAILURE = 0;
    const OPERATOR_RESULT_SUCCESS = 1;

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