Skip to content

Commit feae789

Browse files
authored
Update CurdService.php
1 parent bf88727 commit feae789

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/curd/service/CurdService.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class CurdService
2727
'fields' => [],//显示的字段
2828
'ignoreFields' => ['create_time', 'status', 'update_time', 'delete_time'],//忽略字段
2929
'tagsSuffix' => ['tags', 'tag'],//识别为tag类型
30+
'urlSuffix' => ['url', 'urls'],//识别为tag类型
3031
'fileSuffix' => ['file', 'files', 'path', 'paths'],//识别为文件字段
3132
'priSuffix' => ['_id', '_ids'],//识别为别的表的主键
3233
'sortSuffix' => ['sort'],//排序
@@ -917,8 +918,12 @@ protected function getCols()
917918
case 'files':
918919
$this->jsCols .= $space . "{field:'{$v['name']}',title: __('{$name}'),templet: Table.templet.url}," . PHP_EOL;;
919920
break;
921+
case 'url':
922+
$this->jsCols .= $space . "{field:'{$v['name']}',title: __('{$name}'),filter: '{$v['name']}',templet: Table.templet.url}," . PHP_EOL;;
923+
break;
920924
case 'checkbox':
921-
$this->jsCols .= $space . "{field:'{$v['name']}',search: 'select',title: __('{$name}'),filter: '{$v['name']}',selectList:{$listName}List,templet: Table.templet.tags}," . PHP_EOL;;
925+
case 'tags':
926+
$this->jsCols .= $space . "{field:'{$v['name']}',title: __('{$name}'),filter: '{$v['name']}',templet: Table.templet.tags}," . PHP_EOL;;
922927
break;
923928
case 'select':
924929
case 'radio':
@@ -1067,6 +1072,9 @@ protected function getFieldList($model='',$field = '*')
10671072
if ($this->hasSuffix($fieldsName, $this->config['tagsSuffix'])) {
10681073
$v['type'] = "tags";
10691074
}
1075+
if ($this->hasSuffix($fieldsName, $this->config['urlSuffix'])) {
1076+
$v['type'] = "url";
1077+
}
10701078
//指定后缀结尾 且类型为text系列的字段 为富文本编辑器
10711079
if ($this->hasSuffix($fieldsName, $this->config['editorSuffix'])
10721080
&& in_array($v['DATA_TYPE'], ['longtext', 'mediumtext', 'text', 'smalltext', 'tinytext'])) {
@@ -1160,7 +1168,8 @@ protected function getFieldList($model='',$field = '*')
11601168
} else {
11611169
$prefix_url = str_replace('/', '.', $this->controllerNamePrefix);
11621170
}
1163-
$requests = '';$requestsRecycle='';
1171+
$requests = '';
1172+
$requestsRecycle = '';
11641173
foreach ($methodArr as $k => $v) {
11651174
if (!$this->softDelete && $v == 'recycle') continue;
11661175
if ($v != 'refresh') {

0 commit comments

Comments
 (0)