CategorysController.php 679 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace addons\StarChain\backend\controllers;
  3. use addons\StarChain\common\services\CategorysService;
  4. class CategorysController extends BaseController
  5. {
  6. /**
  7. * 导入分类
  8. *
  9. * @return void
  10. */
  11. public function actionIndex()
  12. {
  13. return $this->render($this->action->id);
  14. }
  15. /**
  16. * 导入
  17. *
  18. * @return void
  19. */
  20. public function actionImport()
  21. {
  22. if ($this->request->isAjax) {
  23. $service = new CategorysService(['mall_id' => $this->mall_id]);
  24. return $service->import()
  25. ? $this->success('ok')
  26. : $this->error($service->error);
  27. }
  28. }
  29. }