mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 07:12:47 +08:00
改进关联模型的关联键值和表名读取
This commit is contained in:
@@ -13,6 +13,7 @@ namespace think\model;
|
||||
|
||||
use think\Db;
|
||||
use think\Exception;
|
||||
use think\Loader;
|
||||
use think\model\Pivot;
|
||||
|
||||
class Relation
|
||||
@@ -257,7 +258,7 @@ class Relation
|
||||
*/
|
||||
protected function match($model, $relation, &$result)
|
||||
{
|
||||
$modelName = strtolower(basename(str_replace('\\', '/', $model)));
|
||||
$modelName = Loader::parseName(basename(str_replace('\\', '/', $model)));
|
||||
// 重新组装模型数据
|
||||
foreach ($result->toArray() as $key => $val) {
|
||||
if (strpos($key, '__')) {
|
||||
|
||||
Reference in New Issue
Block a user