作者 郭盛
1 个管道 的构建 通过 耗费 4 秒

修改接口

@@ -1418,10 +1418,16 @@ class Create extends Api @@ -1418,10 +1418,16 @@ class Create extends Api
1418 } 1418 }
1419 1419
1420 if(!empty($id)){ 1420 if(!empty($id)){
1421 - $data = Db::name('savemes')->where('id',$id)->field('id,thumbnail')->find(); 1421 + $info = Db::name('savemes')->where('id',$id)->field('id,type')->find();
  1422 + //生成二维码
  1423 + $page = '/pages/fileDetail/fileDetail?id='.$id.'&'.'type='.$info['type'].'&'.'user_id='.$user_id;
  1424 + $data['thumbnail'] = $this->qrcode($page,$user_id);
1422 } 1425 }
1423 if(!empty($folder_id)){ 1426 if(!empty($folder_id)){
1424 - $data = Db::name('folder')->where('id',$folder_id)->field('id,thumbnail')->find(); 1427 + $type = 0;
  1428 + //生成二维码
  1429 + $page = '/pages/fileDetail/fileDetail?id='.$folder_id.'&'.'type='.$type.'&'.'user_id='.$user_id;
  1430 + $data['thumbnail'] = $this->qrcode($page,$user_id);
1425 } 1431 }
1426 $this->success('success',$data); 1432 $this->success('success',$data);
1427 } 1433 }
@@ -394,7 +394,8 @@ class Index extends Api @@ -394,7 +394,8 @@ class Index extends Api
394 } 394 }
395 } 395 }
396 } 396 }
397 - 397 +
  398 +
398 $v['url'] = request()->domain().'/index/index/filedetail/user_id/'.$v['user_id'].'/file_id/'.$v['id']; 399 $v['url'] = request()->domain().'/index/index/filedetail/user_id/'.$v['user_id'].'/file_id/'.$v['id'];
399 $list = $tree->getChildrenIds($v['id'],true); 400 $list = $tree->getChildrenIds($v['id'],true);
400 $is_have = Db::name('rotor') 401 $is_have = Db::name('rotor')
@@ -577,7 +578,7 @@ class Index extends Api @@ -577,7 +578,7 @@ class Index extends Api
577 578
578 579
579 580
580 - $Info['foleder'] = $data; 581 + $Info['foleder'] = $arrs;
581 $Info['note'] = $this->sundry($arr); 582 $Info['note'] = $this->sundry($arr);
582 $Info['pic'] = $this->sundry($arr_pic); 583 $Info['pic'] = $this->sundry($arr_pic);
583 $Info['video'] = $this->sundry($arr_video); 584 $Info['video'] = $this->sundry($arr_video);
@@ -708,6 +709,7 @@ class Index extends Api @@ -708,6 +709,7 @@ class Index extends Api
708 * 709 *
709 * @ApiHeaders (name=token, type=string, required=true, description="请求的Token") 710 * @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
710 * @ApiParams (name="folder_id", type="inter", required=true, description="文件夹id") 711 * @ApiParams (name="folder_id", type="inter", required=true, description="文件夹id")
  712 + * @ApiParams (name="user_id", type="inter", required=false, description="用户id")
711 * 713 *
712 * @ApiReturn({ 714 * @ApiReturn({
713 "code": 1, 715 "code": 1,
@@ -813,8 +815,10 @@ class Index extends Api @@ -813,8 +815,10 @@ class Index extends Api
813 */ 815 */
814 public function filedetail() 816 public function filedetail()
815 { 817 {
  818 + $qiniu = get_addon_config('qiniu')['cdnurl'];
816 $user_id = $this->auth->id; 819 $user_id = $this->auth->id;
817 $folder_id = $this->request->param('folder_id'); 820 $folder_id = $this->request->param('folder_id');
  821 + $other_user_id = $this->request->param('user_id');
818 if(empty($folder_id)){ 822 if(empty($folder_id)){
819 $this->error('缺少必要参数'); 823 $this->error('缺少必要参数');
820 } 824 }
@@ -1055,6 +1059,16 @@ class Index extends Api @@ -1055,6 +1059,16 @@ class Index extends Api
1055 $gong2 = $this->gong(3,$video,$zhuan_video); 1059 $gong2 = $this->gong(3,$video,$zhuan_video);
1056 $data['video'] = $this->sundry($gong2); 1060 $data['video'] = $this->sundry($gong2);
1057 1061
  1062 + if(!empty($other_user_id)){
  1063 + $res_userinfo = Db::name('user')->where('id',$other_user_id)->field('username,avatar')->find();
  1064 + $data['username'] = $res_userinfo['username'];
  1065 + if(!empty($res_userinfo['avatar'])){
  1066 + $data['avatar'] = $qiniu.$res_userinfo['avatar'];
  1067 + }else{
  1068 + $data['avatar'] = '';
  1069 + }
  1070 + }
  1071 +
1058 $this->success('success',$data); 1072 $this->success('success',$data);
1059 } 1073 }
1060 1074