Comment.php 554 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace app\api\controller\product;
  3. use app\api\controller\Controller;
  4. use app\api\model\product\Comment as CommentModel;
  5. /**
  6. * 商品评价控制器
  7. */
  8. class Comment extends Controller
  9. {
  10. /**
  11. * 商品评价列表
  12. */
  13. public function lists($product_id, $scoreType = -1)
  14. {
  15. $model = new CommentModel;
  16. $list = $model->getProductCommentList($product_id, $scoreType, $this->postData());
  17. $total = $model->getTotal($product_id);
  18. return $this->renderSuccess('', compact('list', 'total'));
  19. }
  20. }