瀏覽代碼

fix: 城市字母筛选数据接口

wh 2 年之前
父節點
當前提交
955c429923
共有 3 個文件被更改,包括 76 次插入2 次删除
  1. 33 2
      app/controller/admin/system/attachment/Attachment.php
  2. 39 0
      index.html
  3. 4 0
      route/api.php

+ 33 - 2
app/controller/admin/system/attachment/Attachment.php

@@ -24,7 +24,7 @@ use think\db\exception\DataNotFoundException;
 use think\db\exception\DbException;
 use think\db\exception\ModelNotFoundException;
 use think\response\Json;
-
+use app\common\traits\GpsTrait;
 /**
  * Class Attachment
  * @package app\controller\admin\system\attachment
@@ -33,6 +33,7 @@ use think\response\Json;
  */
 class Attachment extends BaseController
 {
+    use GpsTrait;
     /**
      * @var AttachmentRepository
      */
@@ -91,7 +92,6 @@ class Attachment extends BaseController
             'fileExt' => 'jpg,jpeg,png,bmp,gif',
             'fileMime' => 'image/jpeg,image/png,image/gif',
         ]])->check([$field => $file]);
-
         $type = (int)systemConfig('upload_type') ?: 1;
         $upload = UploadService::create($type);
         $data = $upload->to($info['enname'])->move($field);
@@ -99,6 +99,35 @@ class Attachment extends BaseController
             return app('json')->fail($upload->getError());
         }
         $res = $upload->getUploadInfo();
+        // var_dump($res['dir']);
+        //获取图片地址
+        // $imgPath = app()->getRootPath() . 'public'.$res['dir'];
+        // $imgInfoAll = exif_read_data($imgPath,0,1); 
+        // foreach($imgInfoAll as $section => $arrValue){ 
+        //     foreach($arrValue as $key => $value){ 
+        //         $infoAllKey[] = $key; 
+        //         $infoAllValue[] = $value; 
+        //     } 
+        // } 
+        // $infoAll = array_combine($infoAllKey,$infoAllValue); 
+        // $lat = $long = '';
+        // if(isset($infoAll['GPSLatitude']) && !empty($infoAll['GPSLatitude']) )
+        // {
+        //     $latitude  = $infoAll['GPSLatitude'];   //纬度  
+        //     $longitude = $infoAll['GPSLongitude']; //经度	
+        //     $GPSLatitudeRef  = $infoAll['GPSLatitudeRef']; //南半球 S 北半球 N	
+        //     $GPSLongitudeRef = $infoAll['GPSLongitudeRef']; //东半球 S 西半球 N	
+        //     $latitude  = $this->getGps($latitude);
+        //     $lat      = bcadd($latitude['degrees'] , bcadd($latitude['minutes']/60 , $latitude['seconds']/3600,6),6);
+        //     $longitude = $this->getGps($longitude);
+        //     $long      = bcadd($longitude['degrees'] , bcadd($longitude['minutes']/60 , $longitude['seconds']/3600,6),6);
+            
+        // }
+        // else
+        // {
+        //     //是否强制要求使用带gps信息定位的图片
+
+        // }
         $res['dir'] = tidy_url($res['dir']);
         $_name = '.' . $file->getOriginalExtension();
         $data = [
@@ -117,6 +146,8 @@ class Attachment extends BaseController
         return app('json')->success(['src' => $data['attachment_src']]);
     }
 
+
+    
     /**
      * 获取列表
      * @return Json

+ 39 - 0
index.html

@@ -0,0 +1,39 @@
+<!doctype html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>恭喜,站点创建成功!</title>
+    <style>
+        .container {
+            width: 60%;
+            margin: 10% auto 0;
+            background-color: #f0f0f0;
+            padding: 2% 5%;
+            border-radius: 10px
+        }
+
+        ul {
+            padding-left: 20px;
+        }
+
+            ul li {
+                line-height: 2.3
+            }
+
+        a {
+            color: #20a53a
+        }
+    </style>
+</head>
+<body>
+    <div class="container">
+        <h1>恭喜, 站点创建成功!</h1>
+        <h3>这是默认index.html,本页面由系统自动生成</h3>
+        <ul>
+            <li>本页面在FTP根目录下的index.html</li>
+            <li>您可以修改、删除或覆盖本页面</li>
+            <li>FTP相关信息,请到“面板系统后台 > FTP” 查看</li>
+        </ul>
+    </div>
+</body>
+</html>

+ 4 - 0
route/api.php

@@ -113,6 +113,8 @@ Route::group('api/', function () {
             Route::post('change/password', 'User/changePassword');
             //收藏
             Route::get('/relation/product/lst', 'UserRelation/productList');
+
+            //收藏商户、工厂,可通过商户的类别查询即可( type_id )
             Route::get('/relation/merchant/lst', 'UserRelation/merchantList');
             Route::post('/relation/create', 'UserRelation/create');
             Route::post('/relation/batch/create', 'UserRelation/batchCreate');
@@ -531,6 +533,8 @@ Route::group('api/', function () {
     Route::get('system/city/lst', 'merchant.store.shipping.City/getlist');
     Route::get('v2/system/city/lst/:pid', 'merchant.store.shipping.City/lstV2');
     Route::get('v2/system/city', 'merchant.store.shipping.City/cityList');
+    //城市字母表
+    Route::get('v2/system/city/letter', 'merchant.store.shipping.City/letter');
 
     //热门搜索
     Route::get('common/hot_keyword', 'api.Common/hotKeyword')->append(['type'  => 0]);