修复一键生成CRUD时admin_ids字段对应控制器错误

pull/49/head
PPPSCN 2018-03-14 10:53:09 +08:00
parent 8e5b42f88c
commit 0c3e087f09
2 changed files with 7 additions and 2 deletions

1
.gitignore vendored
View File

@ -13,3 +13,4 @@ composer.lock
*.css.map
!.gitkeep
.env
/.svn

View File

@ -580,8 +580,8 @@ class Crud extends Command
}
$formAddElement = $formEditElement = Form::hidden($fieldName, $no, array_merge(['checked' => ''], $attrArr));
$attrArr['id'] = $fieldName . "-switch";
$formAddElement .= sprintf(Form::label("{$attrArr['id']}", "%s {:__('Yes')}", ['class'=>'control-label']), Form::checkbox($fieldName, $yes, $defaultValue === $yes, $attrArr));
$formEditElement .= sprintf(Form::label("{$attrArr['id']}", "%s {:__('Yes')}", ['class'=>'control-label']), Form::checkbox($fieldName, $yes, 0, $attrArr));
$formAddElement .= sprintf(Form::label("{$attrArr['id']}", "%s {:__('Yes')}", ['class' => 'control-label']), Form::checkbox($fieldName, $yes, $defaultValue === $yes, $attrArr));
$formEditElement .= sprintf(Form::label("{$attrArr['id']}", "%s {:__('Yes')}", ['class' => 'control-label']), Form::checkbox($fieldName, $yes, 0, $attrArr));
$formEditElement = str_replace('type="checkbox"', 'type="checkbox" {in name="' . "\$row.{$field}" . '" value="' . $yes . '"}checked{/in}', $formEditElement);
}
else if ($inputType == 'citypicker')
@ -611,6 +611,10 @@ class Crud extends Command
$search = '"##replacetext##"';
$replace = '\'{"custom[type]":"' . $table . '"}\'';
}
elseif ($selectpageController == 'admin')
{
$attrArr['data-source'] = 'auth/admin';
}
if ($this->isMatchSuffix($field, $this->selectpagesSuffix))
{
$attrArr['data-multiple'] = 'true';