正在显示
3 个修改的文件
包含
16 行增加
和
20 行删除
@@ -338,10 +338,10 @@ class Index extends Api | @@ -338,10 +338,10 @@ class Index extends Api | ||
338 | "data": { | 338 | "data": { |
339 | "id": 1, //职位ID | 339 | "id": 1, //职位ID |
340 | "job_name": "测试职位", //职位名称 | 340 | "job_name": "测试职位", //职位名称 |
341 | - "images": [ //图片 | ||
342 | - "http://www.recruit.top/uploads/20201121/3451459c2469a191a84de24d2e6852b5.png" | ||
343 | - ], | ||
344 | - "video": "", //视频 | 341 | + "images": [{ //图片 |
342 | + "type": "image", //文件类型:image=图片,video=视频 | ||
343 | + "url": "http://www.recruit.top/uploads/20201121/3451459c2469a191a84de24d2e6852b5.png" //文件地址 | ||
344 | + }], | ||
345 | "content": "<p>456</p>", //职位详情 | 345 | "content": "<p>456</p>", //职位详情 |
346 | "factory_price": "60.00", //正常工价 | 346 | "factory_price": "60.00", //正常工价 |
347 | "subsidy_price": "10.00", //平台补贴价格 | 347 | "subsidy_price": "10.00", //平台补贴价格 |
@@ -359,7 +359,7 @@ class Index extends Api | @@ -359,7 +359,7 @@ class Index extends Api | ||
359 | empty($info) && $this->error('职位信息不存在'); | 359 | empty($info) && $this->error('职位信息不存在'); |
360 | $collect = JobCollect::where('user_id',$this->auth->id)->where('job_id',$job_id)->find(); | 360 | $collect = JobCollect::where('user_id',$this->auth->id)->where('job_id',$job_id)->find(); |
361 | $info->is_collect = !empty($collect) ? 1 : 0; | 361 | $info->is_collect = !empty($collect) ? 1 : 0; |
362 | - $info->visible(['id','images','video','job_name','factory_price_total','factory_price','subsidy_price','salary','content'])->append(['is_collect']); | 362 | + $info->visible(['id','images','job_name','factory_price_total','factory_price','subsidy_price','salary','content'])->append(['is_collect']); |
363 | $this->success('成功',$info); | 363 | $this->success('成功',$info); |
364 | } | 364 | } |
365 | 365 |
@@ -19,19 +19,15 @@ class Job extends Model | @@ -19,19 +19,15 @@ class Job extends Model | ||
19 | } | 19 | } |
20 | 20 | ||
21 | // 格式化图片 | 21 | // 格式化图片 |
22 | - public function getImagesAttr($value){ | ||
23 | - if(empty($value)){ | ||
24 | - return []; | 22 | + public function getImagesAttr($value,$data){ |
23 | + $arr = []; | ||
24 | + if(!empty($data['video'])){ | ||
25 | + $arr[] = ['type'=>'video','url'=>cdnurl($data['video'],true)]; | ||
25 | } | 26 | } |
26 | $images_arr = explode(',',$value); | 27 | $images_arr = explode(',',$value); |
27 | foreach ($images_arr as &$v){ | 28 | foreach ($images_arr as &$v){ |
28 | - $v = cdnurl($v,true); | 29 | + $arr[] = ['type'=>'image','url'=>cdnurl($v,true)]; |
29 | } | 30 | } |
30 | - return $images_arr; | ||
31 | - } | ||
32 | - | ||
33 | - // 格式化视频 | ||
34 | - public function getVideoAttr($value){ | ||
35 | - return empty($value) ? '' : cdnurl($value,true); | 31 | + return $arr; |
36 | } | 32 | } |
37 | } | 33 | } |
@@ -2124,10 +2124,10 @@ | @@ -2124,10 +2124,10 @@ | ||
2124 | "data": { | 2124 | "data": { |
2125 | "id": 1, //职位ID | 2125 | "id": 1, //职位ID |
2126 | "job_name": "测试职位", //职位名称 | 2126 | "job_name": "测试职位", //职位名称 |
2127 | - "images": [ //图片 | ||
2128 | - "http://www.recruit.top/uploads/20201121/3451459c2469a191a84de24d2e6852b5.png" | ||
2129 | - ], | ||
2130 | - "video": "", //视频 | 2127 | + "images": [{ //图片 |
2128 | + "type": "image", //文件类型:image=图片,video=视频 | ||
2129 | + "url": "http://www.recruit.top/uploads/20201121/3451459c2469a191a84de24d2e6852b5.png" //文件地址 | ||
2130 | + }], | ||
2131 | "content": "<p>456</p>", //职位详情 | 2131 | "content": "<p>456</p>", //职位详情 |
2132 | "factory_price": "60.00", //正常工价 | 2132 | "factory_price": "60.00", //正常工价 |
2133 | "subsidy_price": "10.00", //平台补贴价格 | 2133 | "subsidy_price": "10.00", //平台补贴价格 |
@@ -6704,7 +6704,7 @@ | @@ -6704,7 +6704,7 @@ | ||
6704 | 6704 | ||
6705 | <div class="row mt0 footer"> | 6705 | <div class="row mt0 footer"> |
6706 | <div class="col-md-6" align="left"> | 6706 | <div class="col-md-6" align="left"> |
6707 | - Generated on 2020-11-25 13:28:14 </div> | 6707 | + Generated on 2020-11-25 14:44:22 </div> |
6708 | <div class="col-md-6" align="right"> | 6708 | <div class="col-md-6" align="right"> |
6709 | <a href="./" target="_blank">人力招聘</a> | 6709 | <a href="./" target="_blank">人力招聘</a> |
6710 | </div> | 6710 | </div> |
-
请 注册 或 登录 后发表评论