Commit 45afe5a2 authored by wanjilong's avatar wanjilong

add: 子类开发获取分片策略,支持传参

parent 2cc8b59b
......@@ -318,13 +318,21 @@ abstract class MysqlClusterBase
*
* @return array
*/
private static function getDatabaseShardingIndex()
protected static function getDatabaseShardingIndex($dbShardingColumnValue = 0, $dbShardingCompatColumnValue = 0)
{
// 未使用分库
if (!static::SHARDING_DATABASE) {
return 0;
}
if(!empty($dbShardingColumnValue)) {
self::$dbShardingColumnValue = $dbShardingColumnValue;
}
if(!empty($dbShardingCompatColumnValue)) {
self::$dbShardingCompatColumnValue = $dbShardingCompatColumnValue;
}
self::getDbShardingCount();
$dbShardingIndex = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment