dever 3 years ago
parent
commit
ee282fbfd4
2 changed files with 6 additions and 2 deletions
  1. 4 1
      app/shop/database/info.php
  2. 2 1
      app/shop/lib/Info.php

+ 4 - 1
app/shop/database/info.php

@@ -14,6 +14,8 @@ $type = array
     10 => '平台店',
 );
 
+$col = 'id,name,`desc`,ps_cash,truename,mobile,lng,lat,address,open,worktime,method,gotime,city,area,province,county,town,coupon_city,pdesc,license,food_license,jy_license,license_number,company_name,coord_address';
+
 $act = function()
 {
     $info = Dever::db('act/info')->select();
@@ -66,6 +68,7 @@ return array
     # 后台菜单排序
     'order' => 99,
     'act' => $act,
+    'config_col' => $col,
 
     'end' => array
     (
@@ -633,7 +636,7 @@ return array
                 'state' => 1,
             ),
             'type' => 'one',
-            'col' => 'id,name,`desc`,ps_cash,truename,mobile,lng,lat,address,open,worktime,method,gotime,city,area,province,county,town,coupon_city,pdesc,license,food_license,jy_license,license_number,company_name',
+            'col' => $col,
         ),
     ),
 );

+ 2 - 1
app/shop/lib/Info.php

@@ -217,7 +217,8 @@ class Info
         }
         
         if ($lng && $lat) {
-            $sql = 'select id,name,`desc`,ps_cash,truename,mobile,lng,lat,address,open,worktime,method,gotime,city,area,province,county,town,coupon_city,pdesc,license,food_license,jy_license,license_number,company_name,round((st_distance(point(lng, lat), point('.$lng.', '.$lat.'))*111195)/1000, 2) as distance from {table} where '.$where.' order by distance asc';
+            $col = Dever::db('shop/info')->config['config_col'];
+            $sql = 'select '.$col.',round((st_distance(point(lng, lat), point('.$lng.', '.$lat.'))*111195)/1000, 2) as distance from {table} where '.$where.' order by distance asc';
 
             $data = Dever::db('shop/info')->$method($sql, array(), $page);
         } else {