diff --git a/.htaccess b/.htaccess
new file mode 100644
index 0000000..0519ecb
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/404.html b/404.html
new file mode 100644
index 0000000..6f17eaf
--- /dev/null
+++ b/404.html
@@ -0,0 +1,7 @@
+
+
404 Not Found
+
+404 Not Found
+
nginx
+
+
\ No newline at end of file
diff --git a/app/api/controller/Geo.gc.php b/app/api/controller/Geo.gc.php
new file mode 100644
index 0000000..55e48b1
--- /dev/null
+++ b/app/api/controller/Geo.gc.php
@@ -0,0 +1,96 @@
+ ['except' => ['province','city','area','street','village','brigade'] ]
+ ];
+
+ /**
+ * 省
+ */
+ public function province(){
+ $res = Db::table('fa_geo_province')->where(['switch'=>1])
+ ->field('province_id id,province_code code,province_name name')
+ ->select();
+ $this->apiSuccess('OK',$res);
+ }
+
+ /**
+ * 市
+ */
+ public function city(){
+ $pcode = get_params('pcode');
+ // $pcode = '130000';
+ if(!$pcode) $this->apiError('请先选择省份');
+ $res = Db::table('fa_geo_city')->where(['switch'=>1,'province_code'=>$pcode])
+ ->field('city_id id,city_code code,city_name name')
+ ->select();
+ $this->apiSuccess('OK',$res);
+ }
+
+ /**
+ * 区
+ */
+ public function area(){
+ $pcode = get_params('pcode');
+ // $pcode = '140100';
+ if(!$pcode) $this->apiError('请先选择城市');
+ $res = Db::table('fa_geo_area')->where(['switch'=>1,'city_code'=>$pcode])
+ ->field('area_id id,area_code code,area_name name')
+ ->select();
+ $this->apiSuccess('OK',$res);
+ }
+
+ /**
+ * 街道
+ */
+ public function street(){
+ $pcode = get_params('pcode');
+ // $pcode = '410102';
+ if(!$pcode) $this->apiError('请先选择区/县');
+ $res = Db::table('fa_geo_street')->where(['switch'=>1,'area_code'=>$pcode])
+ ->field('street_id id,street_code code,street_name name')
+ ->select();
+ $this->apiSuccess('OK',$res);
+ }
+
+ /**
+ * 村
+ */
+ public function village(){
+ $pcode = get_params('pcode');
+ // $pcode = '410102';
+ if(!$pcode) $this->apiError('请先选择镇/街道');
+ $res = Db::table('fa_geo_village')->where(['switch'=>1,'street_code'=>$pcode])
+ ->field('village_id id,village_code code,village_name name')
+ ->select();
+ $this->apiSuccess('OK',$res);
+ }
+
+ /**
+ * 大队
+ */
+ public function brigade(){
+
+ $res = Db::table('fa_geo_brigade')
+ ->select();
+ $this->apiSuccess('OK',$res);
+ }
+
+
+}
diff --git a/app/api/controller/Geo.php b/app/api/controller/Geo.php
index 55e48b1..2f0607c 100644
--- a/app/api/controller/Geo.php
+++ b/app/api/controller/Geo.php
@@ -1,96 +1,127 @@
- ['except' => ['province','city','area','street','village','brigade'] ]
- ];
-
- /**
- * 省
- */
- public function province(){
- $res = Db::table('fa_geo_province')->where(['switch'=>1])
- ->field('province_id id,province_code code,province_name name')
- ->select();
- $this->apiSuccess('OK',$res);
- }
-
- /**
- * 市
- */
- public function city(){
- $pcode = get_params('pcode');
- // $pcode = '130000';
- if(!$pcode) $this->apiError('请先选择省份');
- $res = Db::table('fa_geo_city')->where(['switch'=>1,'province_code'=>$pcode])
- ->field('city_id id,city_code code,city_name name')
- ->select();
- $this->apiSuccess('OK',$res);
- }
-
- /**
- * 区
- */
- public function area(){
- $pcode = get_params('pcode');
- // $pcode = '140100';
- if(!$pcode) $this->apiError('请先选择城市');
- $res = Db::table('fa_geo_area')->where(['switch'=>1,'city_code'=>$pcode])
- ->field('area_id id,area_code code,area_name name')
- ->select();
- $this->apiSuccess('OK',$res);
- }
-
- /**
- * 街道
- */
- public function street(){
- $pcode = get_params('pcode');
- // $pcode = '410102';
- if(!$pcode) $this->apiError('请先选择区/县');
- $res = Db::table('fa_geo_street')->where(['switch'=>1,'area_code'=>$pcode])
- ->field('street_id id,street_code code,street_name name')
- ->select();
- $this->apiSuccess('OK',$res);
- }
-
- /**
- * 村
- */
- public function village(){
- $pcode = get_params('pcode');
- // $pcode = '410102';
- if(!$pcode) $this->apiError('请先选择镇/街道');
- $res = Db::table('fa_geo_village')->where(['switch'=>1,'street_code'=>$pcode])
- ->field('village_id id,village_code code,village_name name')
- ->select();
- $this->apiSuccess('OK',$res);
- }
-
- /**
- * 大队
- */
- public function brigade(){
-
- $res = Db::table('fa_geo_brigade')
- ->select();
- $this->apiSuccess('OK',$res);
- }
-
-
-}
+市->区->街道/农村->大队
+ */
+namespace app\api\controller;
+
+
+use app\api\BaseController;
+use app\api\middleware\Auth;
+use app\api\model\GeoProvince as GeoProvinceModel;
+use app\api\model\GeoCity as GeoCityModel;
+use app\api\model\GeoArea as GeoAreaModel;
+use app\api\model\GeoStreet as GeoStreetModel;
+use app\api\model\GeoVillage as GeoVillageModel;
+use app\api\model\GeoBrigade as GeoBrigadeModel;
+
+/**
+ * 首页接口
+ */
+class Geo1 extends BaseController
+{
+
+ /**
+ * 控制器中间件 [不需要鉴权]
+ * @var array
+ */
+ protected $middleware = [
+ Auth::class => ['except' => ['Province','City','Area','Street','Village', 'Brigade']]
+ ];
+
+ /**
+ * 省
+ *
+ * echo json
+ */
+ function Province(GeoProvinceModel $province){
+ $list = $province::Get();
+
+ $this->apiSuccess('OK',$list);
+ }
+
+ /**
+ * 市
+ *
+ * @param $pcode 码
+ *
+ * @echo json
+ */
+ function City(GeoCityModel $city){
+ $pcode = get_params('pcode');
+ // $pcode = '130000';
+ if(!$pcode) $this->apiError('请先选择省份');
+
+ $list = $city::Get($pcode);
+
+ $this->apiSuccess('OK',$list);
+ }
+
+ /**
+ * 区
+ *
+ * @param $pcode 码
+ *
+ * echo json
+ */
+ function Area(GeoAreaModel $area){
+ $pcode = get_params('pcode');
+ // $pcode = '140100';
+ if(!$pcode) $this->apiError('请先选择城市');
+
+ $list = $area::Get($pcode);
+
+ $this->apiSuccess('OK',$list);
+ }
+
+ /**
+ * 镇/街道
+ *
+ * @param $pcode 码
+ *
+ * echo json
+ */
+ function Street(GeoStreetModel $street){
+ $pcode = get_params('pcode');
+ // $pcode = '410102';
+ if(!$pcode) $this->apiError('请先选择镇/街道');
+
+ $list = $street::Get($pcode);
+
+ $this->apiSuccess('OK',$list);
+ }
+
+ /**
+ * 村
+ *
+ * @param $pcode 码
+ *
+ * echo json
+ */
+ function Village(GeoVillageModel $village){
+ $pcode = get_params('pcode');
+ // $pcode = '410102';
+ if(!$pcode) $this->apiError('请先选择镇/街道');
+
+ $list = $village::Get($pcode);
+
+ $this->apiSuccess('OK',$list);
+ }
+
+
+ /**
+ * 大队
+ *
+ * @param $pcode 码
+ *
+ * echo json
+ */
+ function Brigade(GeoBrigadeModel $brigade) {
+ $list = $brigade::Get();
+
+ $this->apiSuccess('OK',$list);
+ }
+}
\ No newline at end of file
diff --git a/app/api/model/GeoArea.php b/app/api/model/GeoArea.php
new file mode 100644
index 0000000..1b54431
--- /dev/null
+++ b/app/api/model/GeoArea.php
@@ -0,0 +1,26 @@
+1,'city_code'=>$pcode])
+ ->field('area_id id,area_code code,area_name name')
+ ->select();
+
+ return $list;
+ }
+
+
+}
\ No newline at end of file
diff --git a/app/api/model/GeoBrigade.php b/app/api/model/GeoBrigade.php
new file mode 100644
index 0000000..5ad8392
--- /dev/null
+++ b/app/api/model/GeoBrigade.php
@@ -0,0 +1,22 @@
+1,'province_code'=>$pcode])
+ ->field('city_id id,city_code code,city_name name')
+ ->select();
+
+ return $list;
+ }
+
+
+}
\ No newline at end of file
diff --git a/app/api/model/GeoProvince.php b/app/api/model/GeoProvince.php
new file mode 100644
index 0000000..7083f2e
--- /dev/null
+++ b/app/api/model/GeoProvince.php
@@ -0,0 +1,31 @@
+belongsToMany(User::class,'fa_geo_city','user_id','role_id');
+ // }
+
+ /**
+ * 省
+ */
+ static function Get(){
+ $res = self::where(['switch'=>1])
+ ->field('province_id id,province_code code,province_name name')
+ ->select();
+
+ return $res;
+ }
+
+}
\ No newline at end of file
diff --git a/app/api/model/GeoStreet.php b/app/api/model/GeoStreet.php
new file mode 100644
index 0000000..cdbaaf3
--- /dev/null
+++ b/app/api/model/GeoStreet.php
@@ -0,0 +1,23 @@
+1,'area_code'=>$pcode])
+ ->field('street_id id,street_code code,street_name name')
+ ->select();
+
+ return $list;
+ }
+}
\ No newline at end of file
diff --git a/app/api/model/GeoVillage.php b/app/api/model/GeoVillage.php
new file mode 100644
index 0000000..0913832
--- /dev/null
+++ b/app/api/model/GeoVillage.php
@@ -0,0 +1,25 @@
+1,'street_code'=>$pcode])
+ ->field('village_id id,village_code code,village_name name')
+ ->select();
+
+ return $list;
+ }
+}
\ No newline at end of file
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..86aeca2
--- /dev/null
+++ b/index.html
@@ -0,0 +1,39 @@
+
+
+
+
+ 恭喜,站点创建成功!
+
+
+
+
+
恭喜, 站点创建成功!
+
这是默认index.html,本页面由系统自动生成
+
+ - 本页面在FTP根目录下的index.html
+ - 您可以修改、删除或覆盖本页面
+ - FTP相关信息,请到“面板系统后台 > FTP” 查看
+
+
+
+
\ No newline at end of file