作者 何书鹏
1 个管道 的构建 通过 耗费 0 秒

api更新

... ... @@ -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);
}
... ...
... ... @@ -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;
}
}
... ...
... ... @@ -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 13:28:14 </div>
Generated on 2020-11-25 14:44:22 </div>
<div class="col-md-6" align="right">
<a href="./" target="_blank">人力招聘</a>
</div>
... ...