口腔客户管理系统
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?php
  2. namespace app\admin\controller;
  3. use app\BaseController;
  4. class District extends BaseController
  5. {
  6. protected $noNeedLogin = [''];
  7. protected $noSize = ['*'];
  8. protected $noSecure = [//格式:'请求方式' => ['请求方法' => ['字段1','字段2'],],
  9. // 'post' => ['add' => ['data']]
  10. ];
  11. // public function city()
  12. // {
  13. // try {
  14. // $District_model = new \app\admin\model\District();
  15. // $result = $District_model->city();
  16. // tojson(200, '请求成功', $result);
  17. // } catch (\Exception $e) {
  18. // tojson(10000, $e->getMessage());
  19. // } catch (\Throwable $e) {
  20. // tojson(10000, $e->getMessage());
  21. // }
  22. // }
  23. public function province()
  24. { //获取城市接口地址
  25. try {
  26. $District_model = new \app\admin\model\District();
  27. $result = $District_model->province();
  28. tojson(200, '请求成功', $result);
  29. } catch (\Exception $e) {
  30. tojson(10000, $e->getMessage());
  31. } catch (\Throwable $e) {
  32. tojson(10000, $e->getMessage());
  33. }
  34. }
  35. public function area()
  36. { //获取城市接口地址
  37. try {
  38. $District_model = new \app\admin\model\District();
  39. $result = $District_model->area();
  40. tojson(200, '请求成功', $result);
  41. } catch (\Exception $e) {
  42. tojson(10000, $e->getMessage());
  43. } catch (\Throwable $e) {
  44. tojson(10000, $e->getMessage());
  45. }
  46. }
  47. // public function read()
  48. // {
  49. // try {
  50. // $District_model = new \app\admin\model\District();
  51. // $result = $District_model->read($_GET);
  52. // tojson(200, '请求成功', $result);
  53. // } catch (\Exception $e) {
  54. // tojson(10000, $e->getMessage());
  55. // }
  56. // }
  57. //
  58. // public function getAll()
  59. // {
  60. // try {
  61. // $District_model = new \app\admin\model\District();
  62. // $result = $District_model->getAll($_GET, $this->request->page, $this->request->pageSize);
  63. // tojson(200, '请求成功', $result);
  64. // } catch (\Exception $e) {
  65. // tojson(10000, $e->getMessage());
  66. // }
  67. // }
  68. //
  69. // public function save()
  70. // {
  71. // try {
  72. // $District_model = new \app\admin\model\District();
  73. // $result = $District_model->save($_POST);
  74. // if ($result) {
  75. // tojson(200, '添加成功');
  76. // } else {
  77. // tojson(10000, '添加失败');
  78. // }
  79. // } catch (\Exception $e) {
  80. // tojson(10000, $e->getMessage());
  81. // }
  82. // }
  83. //
  84. // public function update()
  85. // {
  86. // try {
  87. // $District_model = new \app\admin\model\District();
  88. // $result = $District_model->where([$District_model->getPk() => $this->param[$District_model->getPk()]])->update($this->param);
  89. // if ($result) {
  90. // tojson(200, '修改成功');
  91. // } else {
  92. // tojson(10000, '修改失败');
  93. // }
  94. // } catch (\Exception $e) {
  95. // tojson(10000, $e->getMessage());
  96. // }
  97. // }
  98. //
  99. // public function delete()
  100. // {
  101. // try {
  102. // $District_model = new \app\admin\model\District();
  103. // $result = $District_model->where($District_model->getPk(), $this->param[$District_model->getPk()])->delete();
  104. // if ($result) {
  105. // tojson(200, '删除成功');
  106. // } else {
  107. // tojson(10000, '删除失败');
  108. // }
  109. // } catch (\Exception $e) {
  110. // tojson(10000, $e->getMessage());
  111. // }
  112. // }
  113. }