This repository has been archived on 2024-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
yoshop/source/application/api/controller/Comment.php

29 lines
638 B
PHP
Raw Normal View History

2020-04-25 22:20:29 +08:00
<?php
namespace app\api\controller;
use app\api\model\Comment as CommentModel;
/**
* 商品评价控制器
* Class Comment
* @package app\api\controller
*/
class Comment extends Controller
{
/**
* 商品评价列表
* @param $goods_id
* @param int $scoreType
* @return array
* @throws \think\exception\DbException
*/
public function lists($goods_id, $scoreType = -1)
{
$model = new CommentModel;
$list = $model->getGoodsCommentList($goods_id, $scoreType);
$total = $model->getTotal($goods_id);
return $this->renderSuccess(compact('list', 'total'));
}
}