// +---------------------------------------------------------------------- namespace app\controller\store\product; use app\controller\store\AuthController; use app\services\product\product\StoreProductReplyServices; use think\facade\App; /** * 评论管理 控制器 * Class StoreProductReply * @package app\controller\store\product */ class StoreProductReply extends AuthController { public function __construct(App $app, StoreProductReplyServices $service) { parent::__construct($app); $this->services = $service; } /** * 显示资源列表 * * @return \think\Response */ public function index() { $where = $this->request->getMore([ ['is_reply', ''], ['store_name', ''], ['account', ''], ['data', ''], ['product_id', 0] ]); $where['type'] = 1; $where['relation_id'] = $this->storeId; $list = $this->services->sysPage($where); return $this->success($list); } /** * 删除评论 * @param $id * @return mixed */ public function delete($id) { $this->services->del($id); return $this->success('删除成功!'); } /** * 回复评论 * @param $id * @return mixed */ public function set_reply($id) { [$content] = $this->request->postMore([ ['content', ''] ], true); $store_id = $this->storeId; $this->services->setReply((int)$id, $content, 1, (int)$store_id); return $this->success('回复成功!'); } }