Commit c4a3c843 by feixiang

分表设置

parent 35b8a6b5
...@@ -23,6 +23,8 @@ class Split ...@@ -23,6 +23,8 @@ class Split
if ( $collector['map'] !== null && is_array($collector['map'])) { if ( $collector['map'] !== null && is_array($collector['map'])) {
$map = array_flip($collector['map']); $map = array_flip($collector['map']);
} else {
return;
} }
if ( ! self::isTesting() ) { if ( ! self::isTesting() ) {
...@@ -45,10 +47,10 @@ class Split ...@@ -45,10 +47,10 @@ class Split
} elseif ( isset($map[$tableName]) ) { //非实体且分表 } elseif ( isset($map[$tableName]) ) { //非实体且分表
$className = $map[$tableName]; $className = $map[$tableName];
$defaultTbleName = $tableName; $defaultTableName = $tableName;
$tableName = $tableName.'_'.self::getDbNum($className); $tableName = $tableName.'_'.self::getDbNum($className);
//设置分表对应的className //设置分表对应的className
EntityCollector::setCollector($tableName, $defaultTbleName); EntityCollector::setCollector($tableName, $defaultTableName);
} }
......
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