浏览代码

修改路径

15954078560 2 年之前
父节点
当前提交
b3413e02ed

+ 4 - 0
application/api/controller/Index.php

@@ -29,6 +29,7 @@ class Index extends Api
     public function banner()
     {
         $list = Db::name('banner')->field('id, title, image, url')->order('weigh', 'desc')->select();
+        $list = list_domain_image($list, ['image']);
 
         $this->success('轮播图', $list);
     }
@@ -50,6 +51,7 @@ class Index extends Api
         $list = Db::name('active')->field('id, type, title, desc, remark, image, price, maxperson, currentperson, status')
             ->where($where)->page($this->page, $this->pagenum)->order('createtime', 'desc')->select();
 
+        $list = list_domain_image($list, ['image']);
         foreach ($list as &$v) {
             if ($v['maxperson'] <= $v['currentperson']) {
                 $v['is_full'] = 1;
@@ -73,6 +75,7 @@ class Index extends Api
             $this->error('数据不存在');
         }
 
+        $info['image'] = info_domain_image($info, ['image']);
         $info['starttime'] = date('Y-m-d H:i', $info['starttime']);
         $info['endtime'] = date('Y-m-d H:i', $info['endtime']);
         $info['collectiontime'] = date('Y-m-d H:i', $info['collectiontime']);
@@ -87,6 +90,7 @@ class Index extends Api
         }
 
         $info['active_people'] = $active_people;
+        $info['customer_service'] = config('site.customer_service') ? config('site.customer_service') : ''; //客服电话
 
         $this->success('招标详情', $info);
     }

+ 1 - 1
application/api/controller/User.php

@@ -314,7 +314,7 @@ class User extends Api
 
         $data['nickname'] = $user['nickname']; //姓名
         $data['username'] = $user['username']; //UID
-        $data['avatar'] = $user['avatar']; //头像
+        $data['avatar'] = cdnurl($user['avatar']); //头像
         $data['mobile'] = $user['mobile']; //手机号
         $data['money'] = $user['money']; //余额
         $data['realname'] = $user['realname']; //真实姓名

+ 1 - 1
application/common.php

@@ -563,7 +563,7 @@ function localpath_to_netpath($path)
     } elseif (strrpos($path, 'http') !== false) {
         return $path;
     } else {
-        return config('img_url') . str_replace("\\", "/", $path);
+        return config('upload.cdnurl') . str_replace("\\", "/", $path);
     }
 }
 

+ 1 - 1
application/common/model/User.php

@@ -45,7 +45,7 @@ class User extends Model
             //$value = '/assets/img/avatar.png';
             $value = letter_avatar($data['nickname']);
         }
-        return $value;
+        return cdnurl($value);
     }
 
     /**