GoodsCommentController.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop100%开源免费商用商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | 商业版本务必购买商业授权,以免引起法律纠纷
  8. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  9. // | gitee下载:https://gitee.com/likeshop_gitee
  10. // | github下载:https://github.com/likeshop-github
  11. // | 访问官网:https://www.likeshop.cn
  12. // | 访问社区:https://home.likeshop.cn
  13. // | 访问手册:http://doc.likeshop.cn
  14. // | 微信公众号:likeshop技术社区
  15. // | likeshop团队 版权所有 拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshopTeam
  18. // +----------------------------------------------------------------------
  19. namespace app\adminapi\controller\goods;
  20. use app\adminapi\controller\BaseAdminController;
  21. use app\adminapi\lists\goods\GoodsCommentLists;
  22. use app\adminapi\logic\goods\GoodsCommentLogic;
  23. use app\adminapi\validate\goods\GoodsCommentValidate;
  24. class GoodsCommentController extends BaseAdminController
  25. {
  26. /**
  27. * @notes 查看商品评价列表
  28. * @return \think\response\Json
  29. * @author ljj
  30. * @date 2021/8/12 5:00 下午
  31. */
  32. public function lists()
  33. {
  34. return $this->dataLists(new GoodsCommentLists());
  35. }
  36. /**
  37. * @notes 商家回复
  38. * @return \think\response\Json
  39. * @throws \think\db\exception\DataNotFoundException
  40. * @throws \think\db\exception\DbException
  41. * @throws \think\db\exception\ModelNotFoundException
  42. * @author ljj
  43. * @date 2021/8/12 5:26 下午
  44. */
  45. public function reply()
  46. {
  47. $params = (new GoodsCommentValidate())->post()->goCheck('reply');
  48. (new GoodsCommentLogic())->reply($params);
  49. return $this->success('操作成功',[],1,1);
  50. }
  51. /**
  52. * @notes 删除评价
  53. * @return \think\response\Json
  54. * @author ljj
  55. * @date 2021/9/9 11:20 上午
  56. */
  57. public function del()
  58. {
  59. $params = (new GoodsCommentValidate())->post()->goCheck('del');
  60. (new GoodsCommentLogic())->del($params);
  61. return $this->success('删除成功',[],1,1);
  62. }
  63. /**
  64. * @notes 修改评价审核状态
  65. * @return \think\response\Json
  66. * @throws \think\db\exception\DataNotFoundException
  67. * @throws \think\db\exception\DbException
  68. * @throws \think\db\exception\ModelNotFoundException
  69. * @author ljj
  70. * @date 2021/9/9 2:41 下午
  71. */
  72. public function status()
  73. {
  74. $params = (new GoodsCommentValidate())->post()->goCheck('status');
  75. (new GoodsCommentLogic())->status($params);
  76. return $this->success('操作成功',[],1,1);
  77. }
  78. }