// 按照md5的序列分表
$seq = (ord(substr(md5($value), 0, 1)) % $rule['num']) + 1;
break;
default:
if (function_exists($type)) {
// 支持指定函数哈希
$seq = (ord(substr($type($value), 0, 1)) % $rule['num']) + 1;
} else {
// 按照字段的首字母的值分表
$seq = (ord($value{0}) % $rule['num']) + 1;
}
}
return $this->getTable() . '_' . $seq;
} else {
// 当设置的分表字段不在查询条件或者数据中
// 进行联合查询,必须设定 partition['num']
$tableName = [];
for ($i = 0; $i < $rule['num']; $i++) {
$tableName[] = 'SELECT * FROM ' . $this->getTable() . '_' . ($i + 1);
file | /wwwmulu/mdf.zhzyw.com/thinkphp/library/think/db/Query.php |
USER | www |
HOME | /home/www |
HTTP_HOST | mdf.zhzyw.com |
HTTP_USER_AGENT | claudebot |
HTTP_ACCEPT | */* |
PATH_INFO | /hospdeptexpert/31075.html |
REDIRECT_STATUS | 200 |
SERVER_NAME | mdf.zhzyw.com |
SERVER_PORT | 80 |
SERVER_ADDR | 172.17.33.77 |
REMOTE_PORT | 43526 |
REMOTE_ADDR | 3.237.24.82 |
SERVER_SOFTWARE | nginx/1.19.0 |
GATEWAY_INTERFACE | CGI/1.1 |
REQUEST_SCHEME | http |
SERVER_PROTOCOL | HTTP/1.1 |
DOCUMENT_ROOT | /wwwmulu/mdf.zhzyw.com |
DOCUMENT_URI | /index.php |
REQUEST_URI | /hospdeptexpert/31075.html |
SCRIPT_NAME | /index.php |
CONTENT_LENGTH | |
CONTENT_TYPE | |
REQUEST_METHOD | GET |
QUERY_STRING | s=/hospdeptexpert/31075.html |
SCRIPT_FILENAME | /wwwmulu/mdf.zhzyw.com/index.php |
FCGI_ROLE | RESPONDER |
PHP_SELF | /index.php |
REQUEST_TIME_FLOAT | 1711717640.8212 |
REQUEST_TIME | 1711717640 |
APP_PATH | /wwwmulu/mdf.zhzyw.com/application/ |
THINK_VERSION | 5.0.0 |
THINK_START_TIME | 1711717640.8217 |
THINK_START_MEM | 408152 |
EXT | .php |
DS | / |
THINK_PATH | /wwwmulu/mdf.zhzyw.com/thinkphp/ |
LIB_PATH | /wwwmulu/mdf.zhzyw.com/thinkphp/library/ |
CORE_PATH | /wwwmulu/mdf.zhzyw.com/thinkphp/library/think/ |
TRAIT_PATH | /wwwmulu/mdf.zhzyw.com/thinkphp/library/traits/ |
ROOT_PATH | /wwwmulu/mdf.zhzyw.com/ |
EXTEND_PATH | /wwwmulu/mdf.zhzyw.com/extend/ |
VENDOR_PATH | /wwwmulu/mdf.zhzyw.com/vendor/ |
RUNTIME_PATH | /wwwmulu/mdf.zhzyw.com/runtime/ |
LOG_PATH | /wwwmulu/mdf.zhzyw.com/runtime/log/ |
CACHE_PATH | /wwwmulu/mdf.zhzyw.com/runtime/cache/ |
TEMP_PATH | /wwwmulu/mdf.zhzyw.com/runtime/temp/ |
CONF_PATH | /wwwmulu/mdf.zhzyw.com/application/ |
CONF_EXT | .php |
ENV_PREFIX | PHP_ |
IS_CLI | false |
IS_WIN | false |