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