// +---------------------------------------------------------------------- namespace app\api\controller; use app\common\exception\BaseException; use think\facade\Request; use app\api\service\Comments as CommentsService; class Comments extends Base { /** * 获取商品评论 * @return \think\response\Json */ public function index(){ try{ return $this->returnAjax("ok",1,CommentsService::getList(Request::param())); }catch (BaseException $ex){ return $this->returnAjax($ex->getMessage(),$ex->getCode(),$ex->getRaw()); } } }