post()->goCheck('add', ['user_id' => $this->userId]); $result = (new GoodsCommentLogic())->add($params); if (false === $result) { return $this->fail(GoodsCommentLogic::getError()); } return $this->success('添加成功',[],1,1); } /** * @notes 查看商品评价分类 * @return \think\response\Json * @author ljj * @date 2021/8/6 9:04 下午 */ public function commentCategory() { $params = (new GoodsCommentValidate())->goCheck('CommentCategory'); $result = (new GoodsCommentLogic())->commentCategory($params); return $this->success('',$result); } /** * @notes 查看评论列表 * @return \think\response\Json * @author ljj * @date 2021/8/9 10:25 上午 */ public function lists() { return $this->dataLists(new GoodsCommentLists()); } /** * @notes 评价商品列表 * @return \think\response\Json * @author ljj * @date 2021/8/9 2:45 下午 */ public function commentGoodsLists() { return $this->dataLists(new CommentGoodsLists()); } /** * @notes 查看评价商品信息 * @return \think\response\Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author ljj * @date 2021/8/9 3:12 下午 */ public function commentGoodsInfo() { $params = (new GoodsCommentValidate())->goCheck('CommentGoodsInfo'); $result = (new GoodsCommentLogic())->commentGoodsInfo($params); return $this->success('',$result); } }