mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
curd支持控制器多个关联
This commit is contained in:
@@ -1070,10 +1070,13 @@ class BuildCurdService
|
||||
$controllerExportMethod = '';
|
||||
} else {
|
||||
$relationCode = '';
|
||||
$relation_table = [];
|
||||
|
||||
foreach ($this->relationArray as $key => $val) {
|
||||
$relation = Str::camel($key);
|
||||
$relationCode = "->withJoin('{$relation}', 'LEFT')\r";
|
||||
$relation_table[] = $relation;
|
||||
}
|
||||
$relationCode = "->withJoin(['" . implode('\',\'', $relation_table) . "'], 'LEFT')\r";
|
||||
$controllerIndexMethod = $this->replaceTemplate(
|
||||
$this->getTemplate("controller{$this->DS}indexMethod"),
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user