Эх сурвалжийг харах

经纪人增加地图定位

linwu 1 жил өмнө
parent
commit
4e477c0229

+ 4 - 2
app/common/model/Broker.php

@@ -25,8 +25,8 @@ class Broker extends Model
         'province' => 'string',
         'city'     => 'string',
         'district' => 'string',
-        'town'       => 'string',
-        'village'    => 'string',
+        'town'     => 'string',
+        'village'  => 'string',
         'details'  => 'string',
 
         'status'       => 'tinyint',
@@ -35,6 +35,8 @@ class Broker extends Model
         'income'       => 'decimal',
         'income_total' => 'decimal',
         'region'       => 'string',
+        'latitude'     => 'float',
+        'longitude'    => 'float',
     ];
 
     // 设置字段自动转换类型

+ 3 - 3
app/mainapp/controller/Broker.php

@@ -34,9 +34,9 @@ class Broker extends BaseController
         if (!empty($searchval)) {
             $map[] = ['title|region', 'like', '%' . $searchval . '%'];
         }
-        $district = input('district/s', "");
-        if (!empty($district)) {
-            $map[] = ['district', '=', $district];
+        $town = input('town/s', "");
+        if (!empty($town)) {
+            $map[] = ['town', '=', $town];
         }
         $plist = BrokerModel::with(['muser'])->where($map)->order(['id' => 'desc'])->page($ppage)->limit($psize)->select();
         page_result(0, "", [

+ 7 - 0
app/mainapp/controller/Index.php

@@ -250,4 +250,11 @@ class Index extends BaseController
         $town = file_get_contents(root_path('public/static/jscss').'town.json');
         page_result(0,'',json_decode($town,true));
     }
+
+    public function getStreet()
+    {
+        $town = file_get_contents(root_path('public/static/jscss').'town.json');
+        $street = json_decode($town,true)['town'];
+        page_result(0,'',$street);
+    }
 }