GoodsController.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\api\controller;
  15. use app\api\lists\GoodsLists;
  16. /**
  17. * 用户控制器
  18. * Class UserController
  19. * @package app\api\controller
  20. */
  21. class GoodsController extends BaseApiController
  22. {
  23. public array $notNeedLogin = ['lists'];
  24. public function lists()
  25. {
  26. return $this->dataLists(new GoodsLists());
  27. }
  28. public function hotData(){
  29. $result = GoodsLogic::getHotData();
  30. return $this->data($result);
  31. }
  32. public function detail()
  33. {
  34. $id = $this->request->get('id/d');
  35. $result = GoodsLogic::detail($id, $this->userId);
  36. return $this->data($result);
  37. }
  38. }