<?php
namespace App\Models\demo\mysql;

use Api\PhpUtils\Mysql\Base;

class User extends Base
{
    protected static $write;

    protected static $read;

    protected static $db_config_index = 'metro';

    protected function getConfigIndex()
    {
        return 'metro';
    }

    protected function getTableName()
    {
        return 'user';
    }

    protected function getPKey()
    {
        return 'id';
    }

    protected function getWhere($params)
    {
        $where = [];
        if (isset($params['ids']) && !empty($params['ids'])) {
            $where['id'] = $params['ids'];
        }
        if (isset($params['name']) && !empty($params['name'])) {
            $where['name'] = $params['name'];
        }
        if (isset($params['id[>]']) && !empty($params['id[>]'])) {
            $where['id[>]'] = $params['id[>]'];
        }
        return $where;
    }
}
