<?php

namespace App\Models\goods\mysql;

use Api\PhpUtils\Mysql\MysqlBase;

/**
 * Class GoodsOperationRecord
 * 商品操作记录
 * @package App\Models\goods\mysql
 */
class GoodsOperationRecord extends MysqlBase
{
    const TABLE_NAME = 'goods_operation_record';
    const CONFIG_INDEX = 'goods';

    const STATUS_AUDIT = 0;//待审核
    const STATUS_PASS = 1;//审核通过
    const STATUS_REJECT = 2;//审核驳回

    public static $statusDesc = [
        self::STATUS_AUDIT => "待审核",
        self::STATUS_PASS => "审核通过",
        self::STATUS_REJECT => "审核驳回",
    ];

    const ONLINE_STATUS_UN_ONLINE = 0;//未上架
    const ONLINE_STATUS_ONLINE = 1;//已上架
    const ONLINE_STATUS_OFFLINE = 2;//已下架

    public static $onlineStatusDesc = [
        self::ONLINE_STATUS_UN_ONLINE => "未上架",
        self::ONLINE_STATUS_ONLINE => "已上架",
        self::ONLINE_STATUS_OFFLINE => "已下架",
    ];

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

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