<?php

namespace App\Models\marketing\mysql;

use Api\PhpUtils\Mysql\MysqlBase;

/**
 * 拼单活动和自提点关联
 * Class MarketingTakePlace
 * @package App\Models\marketing\mysql
 */
class MarketingTakePlace extends MysqlBase
{
    const TABLE_NAME = 'marketing_take_place';
    const CONFIG_INDEX = 'marketing';
    const PRIMARY_KEY = 'marketing_take_place_id';

    public static function save($data, $where = [])
    {
        if (empty($where)) {
            return self::insert($data);
        }
        return self::update($data, $where);
    }

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