CommonController.php 700 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace addons\Community\backend\controllers;
  3. use addons\Community\common\service\CommunityService;
  4. use Yii;
  5. /**
  6. * 公共控制器
  7. *
  8. * Class CommonController
  9. * @package addons\Community\backend\controllers
  10. */
  11. class CommonController extends BaseController
  12. {
  13. /**
  14. * 获取社区小区列表
  15. *
  16. * @return mixed
  17. */
  18. public function actionRegionList()
  19. {
  20. if (Yii::$app->request->isAjax) {
  21. $level = Yii::$app->request->get('level', 2);
  22. $service = new CommunityService(['mall_id' => $this->mall_id]);
  23. $list = $service->getRegionList($level);
  24. return $this->success('ok', compact('list'));
  25. }
  26. }
  27. }