切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Karson
6 years ago
提交
f9d14aa693d8cd490dae51cd75fd09fcd01f6098
1 个父辈
843a10fa
修复主键非ID时的排序错误
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
8 行增加
和
5 行删除
application/admin/controller/Ajax.php
public/assets/js/require-table.js
application/admin/controller/Ajax.php
查看文件 @
f9d14aa
...
...
@@ -147,12 +147,14 @@ class Ajax extends Backend
$field
=
$this
->
request
->
post
(
"field"
);
//操作的数据表
$table
=
$this
->
request
->
post
(
"table"
);
//主键
$pk
=
$this
->
request
->
post
(
"pk"
);
//排序的方式
$orderway
=
$this
->
request
->
post
(
"orderway"
,
""
,
'strtolower'
);
$orderway
=
$orderway
==
'asc'
?
'ASC'
:
'DESC'
;
$sour
=
$weighdata
=
[];
$ids
=
explode
(
','
,
$ids
);
$prikey
=
'id'
;
$prikey
=
$pk
?
$pk
:
(
Db
::
name
(
$table
)
->
getPk
()
?:
'id'
)
;
$pid
=
$this
->
request
->
post
(
"pid"
);
//限制更新的字段
$field
=
in_array
(
$field
,
[
'weigh'
])
?
$field
:
'weigh'
;
...
...
@@ -160,9 +162,9 @@ class Ajax extends Backend
// 如果设定了pid的值,此时只匹配满足条件的ID,其它忽略
if
(
$pid
!==
''
)
{
$hasids
=
[];
$list
=
Db
::
name
(
$table
)
->
where
(
$prikey
,
'in'
,
$ids
)
->
where
(
'pid'
,
'in'
,
$pid
)
->
field
(
'id,pid'
)
->
select
();
$list
=
Db
::
name
(
$table
)
->
where
(
$prikey
,
'in'
,
$ids
)
->
where
(
'pid'
,
'in'
,
$pid
)
->
field
(
"
{
$prikey
}
,pid"
)
->
select
();
foreach
(
$list
as
$k
=>
$v
)
{
$hasids
[]
=
$v
[
'id'
];
$hasids
[]
=
$v
[
$prikey
];
}
$ids
=
array_values
(
array_intersect
(
$ids
,
$hasids
));
}
...
...
public/assets/js/require-table.js
查看文件 @
f9d14aa
...
...
@@ -277,7 +277,8 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
pid
:
pid
,
field
:
Table
.
config
.
dragsortfield
,
orderway
:
options
.
sortOrder
,
table
:
options
.
extend
.
table
table
:
options
.
extend
.
table
,
pk
:
options
.
pk
}
};
Fast
.
api
.
ajax
(
params
,
function
(
data
,
ret
)
{
...
...
@@ -409,7 +410,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
});
Layer
.
photos
({
photos
:
{
"start"
:
$
(
this
).
index
(
".img-center"
),
"start"
:
$
(
this
).
index
(
".img-center"
),
"data"
:
data
},
anim
:
5
//0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
...
...
请
注册
或
登录
后发表评论