GoodsGatherController.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop开源商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | gitee下载:https://gitee.com/likeshop_gitee
  7. // | github下载:https://github.com/likeshop-github
  8. // | 访问官网:https://www.likeshop.cn
  9. // | 访问社区:https://home.likeshop.cn
  10. // | 访问手册:http://doc.likeshop.cn
  11. // | 微信公众号:likeshop技术社区
  12. // | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
  13. // | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
  14. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  15. // | likeshop团队版权所有并拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshop.cn.team
  18. // +----------------------------------------------------------------------
  19. namespace app\adminapi\controller\goods;
  20. use app\adminapi\controller\BaseAdminController;
  21. use app\adminapi\lists\goods\GoodsGatherLists;
  22. use app\adminapi\lists\goods\GoodsGatherLogLists;
  23. use app\adminapi\logic\goods\GoodsGatherLogic;
  24. use app\adminapi\validate\goods\GoodsGatherValidate;
  25. use app\adminapi\validate\goods\GoodsItemValidate;
  26. class GoodsGatherController extends BaseAdminController
  27. {
  28. /**
  29. * @notes 商品采集记录列表
  30. * @return \think\response\Json
  31. * @author ljj
  32. * @date 2023/3/13 3:23 下午
  33. */
  34. public function logLists()
  35. {
  36. return $this->dataLists(new GoodsGatherLogLists());
  37. }
  38. /**
  39. * @notes 采集
  40. * @return \think\response\Json
  41. * @author ljj
  42. * @date 2023/3/13 6:36 下午
  43. */
  44. public function gather()
  45. {
  46. $params = (new GoodsGatherValidate())->post()->goCheck('gather');
  47. $result = (new GoodsGatherLogic())->gather($params);
  48. if (true !== $result) {
  49. return $this->fail($result);
  50. }
  51. return $this->success('操作成功');
  52. }
  53. /**
  54. * @notes 删除采集记录
  55. * @return \think\response\Json
  56. * @author ljj
  57. * @date 2023/3/14 9:41 上午
  58. */
  59. public function del()
  60. {
  61. $params = (new GoodsGatherValidate())->post()->goCheck('del');
  62. (new GoodsGatherLogic())->del($params);
  63. return $this->success('操作成功');
  64. }
  65. /**
  66. * @notes 商品采集列表
  67. * @return \think\response\Json
  68. * @author ljj
  69. * @date 2023/3/14 3:06 下午
  70. */
  71. public function lists()
  72. {
  73. return $this->dataLists(new GoodsGatherLists());
  74. }
  75. /**
  76. * @notes 采集商品详情
  77. * @return \think\response\Json
  78. * @author ljj
  79. * @date 2023/3/16 10:56 上午
  80. */
  81. public function gatherGoodsDetail()
  82. {
  83. $params = (new GoodsGatherValidate())->get()->goCheck('gatherGoodsDetail');
  84. $result = (new GoodsGatherLogic())->gatherGoodsDetail($params);
  85. return $this->success('',$result);
  86. }
  87. /**
  88. * @notes 编辑采集商品
  89. * @return \think\response\Json
  90. * @author ljj
  91. * @date 2023/3/16 11:38 上午
  92. */
  93. public function gatherGoodsEdit()
  94. {
  95. $params = (new GoodsGatherValidate())->post()->goCheck('gatherGoodsEdit');
  96. (new GoodsGatherLogic())->gatherGoodsEdit($params);
  97. return $this->success('操作成功');
  98. }
  99. /**
  100. * @notes 创建商品
  101. * @return \think\response\Json
  102. * @author ljj
  103. * @date 2023/3/16 12:09 下午
  104. */
  105. public function createGoods()
  106. {
  107. $params = (new GoodsGatherValidate())->post()->goCheck('createGoods');
  108. (new GoodsItemValidate())->post()->goCheck('',$params); //商品规格验证
  109. $result = (new GoodsGatherLogic())->createGoods($params);
  110. if (true !== $result) {
  111. return $this->fail($result);
  112. }
  113. return $this->success('操作成功');
  114. }
  115. }