切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
何书鹏
4 years ago
提交
05af9e52290e570cf987f2b13e4dbe864993795a
1 个父辈
8e9356bc
1 个管道 的构建
通过
耗费 1 秒
职位排序
变更
2
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
2 行增加
和
82 行删除
application/admin/controller/Job.php
public/assets/js/backend/job.js
application/admin/controller/Job.php
查看文件 @
05af9e5
...
...
@@ -72,43 +72,4 @@ class Job extends Backend
return
$this
->
view
->
fetch
();
}
/**
* 置顶
*/
public
function
top
(
$ids
=
null
)
{
if
(
$ids
)
{
$row
=
$this
->
model
->
get
(
$ids
);
if
(
!
$row
)
{
$this
->
error
(
__
(
'No Results were found'
));
}
$adminIds
=
$this
->
getDataLimitAdminIds
();
if
(
is_array
(
$adminIds
))
{
if
(
!
in_array
(
$row
[
$this
->
dataLimitField
],
$adminIds
))
{
$this
->
error
(
__
(
'You have no permission'
));
}
}
$params
=
$this
->
request
->
param
();
$params
[
'top_time'
]
=
$params
[
'is_top'
]
==
'1'
?
time
()
:
0
;
Db
::
startTrans
();
try
{
$result
=
$row
->
allowField
(
true
)
->
save
(
$params
);
Db
::
commit
();
}
catch
(
ValidateException
$e
)
{
Db
::
rollback
();
$this
->
error
(
$e
->
getMessage
());
}
catch
(
PDOException
$e
)
{
Db
::
rollback
();
$this
->
error
(
$e
->
getMessage
());
}
catch
(
\think\Exception
$e
)
{
Db
::
rollback
();
$this
->
error
(
$e
->
getMessage
());
}
if
(
!
$result
)
{
$this
->
error
(
'操作失败'
);
}
$this
->
success
(
'操作成功'
);
}
}
}
...
...
public/assets/js/backend/job.js
查看文件 @
05af9e5
...
...
@@ -21,7 +21,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
table
.
bootstrapTable
({
url
:
$
.
fn
.
bootstrapTable
.
defaults
.
extend
.
index_url
,
pk
:
'id'
,
sortName
:
'
is_top desc,top_time desc,
weigh'
,
sortName
:
'weigh'
,
columns
:
[
[
{
checkbox
:
true
},
...
...
@@ -38,48 +38,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{
field
:
'people_num'
,
title
:
__
(
'People_num'
)},
{
field
:
'address'
,
title
:
__
(
'Address'
),
operate
:
'LIKE'
},
{
field
:
'weigh'
,
title
:
__
(
'Weigh'
)},
//操作栏,默认有编辑、删除或排序按钮,可自定义配置buttons来扩展按钮
{
field
:
'operate'
,
title
:
__
(
'Operate'
),
table
:
table
,
events
:
Table
.
api
.
events
.
operate
,
buttons
:
[
{
name
:
'top'
,
text
:
'置顶'
,
title
:
'置顶'
,
classname
:
'btn btn-xs btn-primary btn-ajax'
,
icon
:
'fa fa-long-arrow-up'
,
url
:
'job/top?job_id={id}&is_top=1'
,
visible
:
function
(
row
)
{
if
(
row
.
is_top
==
'0'
){
return
true
;
}
},
success
:
function
(
data
)
{
table
.
bootstrapTable
(
'refresh'
);
}
},
{
name
:
'top'
,
text
:
'取消置顶'
,
title
:
'取消置顶'
,
classname
:
'btn btn-xs btn-danger btn-ajax'
,
icon
:
'fa fa-long-arrow-down'
,
url
:
'job/top?job_id={id}&is_top=0'
,
visible
:
function
(
row
)
{
if
(
row
.
is_top
==
'1'
){
return
true
;
}
},
success
:
function
(
data
)
{
table
.
bootstrapTable
(
'refresh'
);
}
}
],
formatter
:
Table
.
api
.
formatter
.
operate
}
{
field
:
'operate'
,
title
:
__
(
'Operate'
),
table
:
table
,
events
:
Table
.
api
.
events
.
operate
,
formatter
:
Table
.
api
.
formatter
.
operate
}
]
]
});
...
...
请
注册
或
登录
后发表评论