Address.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * Niushop商城系统 - 团队十年电商经验汇集巨献!
  4. * =========================================================
  5. * Copy right 2015-2025 杭州牛之云科技有限公司, 保留所有权利。
  6. * ----------------------------------------------
  7. * 官方网址: https://www.niushop.com
  8. * =========================================================
  9. * @author : niuteam
  10. */
  11. namespace app\api\controller;
  12. use app\model\system\Address as AddressModel;
  13. /**
  14. * 地址管理
  15. * @author Administrator
  16. *
  17. */
  18. class Address extends BaseApi
  19. {
  20. /**
  21. * 基础信息
  22. */
  23. public function info()
  24. {
  25. $id = $this->params['id'];
  26. $address = new AddressModel();
  27. $info = $address->getAreaInfo($id);
  28. return $this->response($info);
  29. }
  30. /**
  31. * 列表信息
  32. */
  33. public function lists()
  34. {
  35. $pid = isset($this->params['pid']) ? $this->params['pid'] : 0;
  36. $address = new AddressModel();
  37. $list = $address->getAreas($pid);
  38. return $this->response($list);
  39. }
  40. /**
  41. * 树状结构信息
  42. */
  43. public function tree()
  44. {
  45. $id = $this->params['id'];
  46. $address = new AddressModel();
  47. $tree = $address->getAreas($id);
  48. return $this->response($tree);
  49. }
  50. }