切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Karson
5 years ago
提交
a2d99f4bdbd9593c9fc81b4457dbc5cb5b3c1609
1 个父辈
8b772d30
修复关联字段时间无法搜索的BUG
优化后台列表逻辑
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
15 行增加
和
21 行删除
application/admin/command/Crud/stubs/controllerindex.stub
application/admin/library/traits/Backend.php
application/common/controller/Backend.php
application/admin/command/Crud/stubs/controllerindex.stub
查看文件 @
a2d99f4
...
...
@@ -8,35 +8,28 @@
$this->relationSearch = {%relationSearch%};
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax())
{
if ($this->request->isAjax()) {
//如果发送的来源是Selectpage,则转发到Selectpage
if ($this->request->request('keyField'))
{
if ($this->request->request('keyField')) {
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
{%relationWithList%}
->where($where)
->order($sort, $order)
->count();
$list = $this->model
{%relationWithList%}
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->
select
();
->
paginate
();
foreach ($list as $row) {
{%visibleFieldList%}
{%relationVisibleFieldList%}
}
$list = collection($list)->toArray();
$result = array("total" => $total, "rows" => $list);
$result = array("total" => $list->total(), "rows" => $list->items());
return json($result);
}
return $this->view->fetch();
}
\ No newline at end of file
}
...
...
application/admin/library/traits/Backend.php
查看文件 @
a2d99f4
...
...
@@ -50,19 +50,14 @@ trait Backend
return
$this
->
selectpage
();
}
list
(
$where
,
$sort
,
$order
,
$offset
,
$limit
)
=
$this
->
buildparams
();
$total
=
$this
->
model
->
where
(
$where
)
->
order
(
$sort
,
$order
)
->
count
();
$list
=
$this
->
model
->
where
(
$where
)
->
order
(
$sort
,
$order
)
->
limit
(
$offset
,
$limit
)
->
select
();
->
paginate
();
$list
=
collection
(
$list
)
->
toArray
();
$result
=
array
(
"total"
=>
$total
,
"rows"
=>
$list
);
$result
=
array
(
"total"
=>
$list
->
total
(),
"rows"
=>
$list
->
items
());
return
json
(
$result
);
}
...
...
@@ -75,7 +70,7 @@ trait Backend
public
function
recyclebin
()
{
//设置过滤方法
$this
->
request
->
filter
([
'strip_tags'
]);
$this
->
request
->
filter
([
'strip_tags'
,
'trim'
]);
if
(
$this
->
request
->
isAjax
())
{
list
(
$where
,
$sort
,
$order
,
$offset
,
$limit
)
=
$this
->
buildparams
();
$total
=
$this
->
model
...
...
application/common/controller/Backend.php
查看文件 @
a2d99f4
...
...
@@ -377,6 +377,12 @@ class Backend extends Controller
$sym
=
$sym
==
'RANGE'
?
'>='
:
'<'
;
$arr
=
$arr
[
0
];
}
$tableArr
=
explode
(
'.'
,
$k
);
if
(
count
(
$tableArr
)
>
1
)
{
//修复关联模型下时间无法搜索的BUG
$relation
=
Loader
::
parseName
(
$tableArr
[
0
],
1
,
false
);
$this
->
model
->
alias
([
$this
->
model
->
$relation
()
->
getTable
()
=>
$tableArr
[
0
]]);
}
$where
[]
=
[
$k
,
str_replace
(
'RANGE'
,
'BETWEEN'
,
$sym
)
.
' time'
,
$arr
];
break
;
case
'NULL'
:
...
...
请
注册
或
登录
后发表评论