Browse Source

banner接口

zhangxiaobin 1 year ago
parent
commit
850491c4f4
2 changed files with 4 additions and 2 deletions
  1. 3 1
      application/api/controller/Banner.php
  2. 1 1
      application/extra/upload.php

+ 3 - 1
application/api/controller/Banner.php

@@ -32,7 +32,9 @@ class Banner extends Api
             $where['company_id'] = $companyId;
             $result = $this->model->field($field)->where($where)->order('weigh asc')->select();
             if (!empty($result)) {
-                !empty($result['image']) && $result['image'] = cdnurl($result['image']);
+                foreach ($result as $key => &$value) {
+                    !empty($value['image']) && $value['image'] = cdnurl($value['image']);
+                }
             }
             $this->success('获取成功',$result);
         } catch (Exception $e) {

+ 1 - 1
application/extra/upload.php

@@ -9,7 +9,7 @@ return [
     /**
      * CDN地址
      */
-    'cdnurl'    => '',
+    'cdnurl'    => 'https://ceshi-1302263099.cos.ap-shanghai.myqcloud.com',
     /**
      * 文件保存格式
      */