Comments.php 953 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | A3Mall
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2020 http://www.a3-mall.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Author: xzncit <158373108@qq.com>
  8. // +----------------------------------------------------------------------
  9. namespace app\api\controller;
  10. use app\common\exception\BaseException;
  11. use think\facade\Request;
  12. use app\api\service\Comments as CommentsService;
  13. class Comments extends Base {
  14. /**
  15. * 获取商品评论
  16. * @return \think\response\Json
  17. */
  18. public function index(){
  19. try{
  20. return $this->returnAjax("ok",1,CommentsService::getList(Request::param()));
  21. }catch (BaseException $ex){
  22. return $this->returnAjax($ex->getMessage(),$ex->getCode(),$ex->getRaw());
  23. }
  24. }
  25. }