|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <?php
-
- namespace app\admin\controller;
-
- use app\BaseController;
-
- class District extends BaseController
- {
-
- protected $noNeedLogin = [''];
- protected $noSize = ['*'];
- protected $noSecure = [//格式:'请求方式' => ['请求方法' => ['字段1','字段2'],],
- // 'post' => ['add' => ['data']]
- ];
-
- // public function city()
- // {
- // try {
- // $District_model = new \app\admin\model\District();
- // $result = $District_model->city();
- // tojson(200, '请求成功', $result);
- // } catch (\Exception $e) {
- // tojson(10000, $e->getMessage());
- // } catch (\Throwable $e) {
- // tojson(10000, $e->getMessage());
- // }
- // }
-
- public function province()
- { //获取城市接口地址
- try {
- $District_model = new \app\admin\model\District();
- $result = $District_model->province();
- tojson(200, '请求成功', $result);
- } catch (\Exception $e) {
- tojson(10000, $e->getMessage());
- } catch (\Throwable $e) {
- tojson(10000, $e->getMessage());
- }
- }
-
- public function area()
- { //获取城市接口地址
- try {
- $District_model = new \app\admin\model\District();
- $result = $District_model->area();
- tojson(200, '请求成功', $result);
- } catch (\Exception $e) {
- tojson(10000, $e->getMessage());
- } catch (\Throwable $e) {
- tojson(10000, $e->getMessage());
- }
- }
-
- // public function read()
- // {
- // try {
- // $District_model = new \app\admin\model\District();
- // $result = $District_model->read($_GET);
- // tojson(200, '请求成功', $result);
- // } catch (\Exception $e) {
- // tojson(10000, $e->getMessage());
- // }
- // }
- //
- // public function getAll()
- // {
- // try {
- // $District_model = new \app\admin\model\District();
- // $result = $District_model->getAll($_GET, $this->request->page, $this->request->pageSize);
- // tojson(200, '请求成功', $result);
- // } catch (\Exception $e) {
- // tojson(10000, $e->getMessage());
- // }
- // }
- //
- // public function save()
- // {
- // try {
- // $District_model = new \app\admin\model\District();
- // $result = $District_model->save($_POST);
- // if ($result) {
- // tojson(200, '添加成功');
- // } else {
- // tojson(10000, '添加失败');
- // }
- // } catch (\Exception $e) {
- // tojson(10000, $e->getMessage());
- // }
- // }
- //
- // public function update()
- // {
- // try {
- // $District_model = new \app\admin\model\District();
- // $result = $District_model->where([$District_model->getPk() => $this->param[$District_model->getPk()]])->update($this->param);
- // if ($result) {
- // tojson(200, '修改成功');
- // } else {
- // tojson(10000, '修改失败');
- // }
- // } catch (\Exception $e) {
- // tojson(10000, $e->getMessage());
- // }
- // }
- //
- // public function delete()
- // {
- // try {
- // $District_model = new \app\admin\model\District();
- // $result = $District_model->where($District_model->getPk(), $this->param[$District_model->getPk()])->delete();
- // if ($result) {
- // tojson(200, '删除成功');
- // } else {
- // tojson(10000, '删除失败');
- // }
- // } catch (\Exception $e) {
- // tojson(10000, $e->getMessage());
- // }
- // }
-
- }
|