切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
何书鹏
4 years ago
提交
f74cbbb3e456cf637c41f1119c15c3ee725e9045
1 个父辈
c74ff911
1 个管道 的构建
通过
耗费 0 秒
api更新
变更
3
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
16 行增加
和
20 行删除
application/api/controller/Index.php
application/api/model/Job.php
public/api.html
application/api/controller/Index.php
查看文件 @
f74cbbb
...
...
@@ -338,10 +338,10 @@ class Index extends Api
"data": {
"id": 1, //职位ID
"job_name": "测试职位", //职位名称
"images": [ //图片
"http://www.recruit.top/uploads/20201121/3451459c2469a191a84de24d2e6852b5.png"
],
"video": "", //视频
"images": [{ //图片
"type": "image", //文件类型:image=图片,video=视频
"url": "http://www.recruit.top/uploads/20201121/3451459c2469a191a84de24d2e6852b5.png" //文件地址
}],
"content": "<p>456</p>", //职位详情
"factory_price": "60.00", //正常工价
"subsidy_price": "10.00", //平台补贴价格
...
...
@@ -359,7 +359,7 @@ class Index extends Api
empty
(
$info
)
&&
$this
->
error
(
'职位信息不存在'
);
$collect
=
JobCollect
::
where
(
'user_id'
,
$this
->
auth
->
id
)
->
where
(
'job_id'
,
$job_id
)
->
find
();
$info
->
is_collect
=
!
empty
(
$collect
)
?
1
:
0
;
$info
->
visible
([
'id'
,
'images'
,
'
video'
,
'
job_name'
,
'factory_price_total'
,
'factory_price'
,
'subsidy_price'
,
'salary'
,
'content'
])
->
append
([
'is_collect'
]);
$info
->
visible
([
'id'
,
'images'
,
'job_name'
,
'factory_price_total'
,
'factory_price'
,
'subsidy_price'
,
'salary'
,
'content'
])
->
append
([
'is_collect'
]);
$this
->
success
(
'成功'
,
$info
);
}
...
...
application/api/model/Job.php
查看文件 @
f74cbbb
...
...
@@ -19,19 +19,15 @@ class Job extends Model
}
// 格式化图片
public
function
getImagesAttr
(
$value
){
if
(
empty
(
$value
)){
return
[];
public
function
getImagesAttr
(
$value
,
$data
){
$arr
=
[];
if
(
!
empty
(
$data
[
'video'
])){
$arr
[]
=
[
'type'
=>
'video'
,
'url'
=>
cdnurl
(
$data
[
'video'
],
true
)];
}
$images_arr
=
explode
(
','
,
$value
);
foreach
(
$images_arr
as
&
$v
){
$
v
=
cdnurl
(
$v
,
true
)
;
$
arr
[]
=
[
'type'
=>
'image'
,
'url'
=>
cdnurl
(
$v
,
true
)]
;
}
return
$images_arr
;
}
// 格式化视频
public
function
getVideoAttr
(
$value
){
return
empty
(
$value
)
?
''
:
cdnurl
(
$value
,
true
);
return
$arr
;
}
}
...
...
public/api.html
查看文件 @
f74cbbb
...
...
@@ -2124,10 +2124,10 @@
"data": {
"id": 1, //职位ID
"job_name": "测试职位", //职位名称
"images": [ //图片
"http://www.recruit.top/uploads/20201121/3451459c2469a191a84de24d2e6852b5.png"
],
"video": "", //视频
"images": [{ //图片
"type": "image", //文件类型:image=图片,video=视频
"url": "http://www.recruit.top/uploads/20201121/3451459c2469a191a84de24d2e6852b5.png" //文件地址
}],
"content": "
<p>
456
</p>
", //职位详情
"factory_price": "60.00", //正常工价
"subsidy_price": "10.00", //平台补贴价格
...
...
@@ -6704,7 +6704,7 @@
<div
class=
"row mt0 footer"
>
<div
class=
"col-md-6"
align=
"left"
>
Generated on 2020-11-25 1
3:28:14
</div>
Generated on 2020-11-25 1
4:44:22
</div>
<div
class=
"col-md-6"
align=
"right"
>
<a
href=
"./"
target=
"_blank"
>
人力招聘
</a>
</div>
...
...
请
注册
或
登录
后发表评论