Service.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2021 https://www.yiovo.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: 萤火科技 <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types = 1);
  12. namespace app\api\controller\goods;
  13. use app\api\controller\Controller;
  14. use app\api\model\goods\Service as ServiceModel;
  15. /**
  16. * 商品服务与承诺管理
  17. * Class Service
  18. * @package app\store\controller\goods
  19. */
  20. class Service extends Controller
  21. {
  22. /**
  23. * 获取指定商品的服务与承诺
  24. * @param int $goodsId
  25. * @return array|\think\response\Json
  26. * @throws \think\db\exception\DataNotFoundException
  27. * @throws \think\db\exception\DbException
  28. * @throws \think\db\exception\ModelNotFoundException
  29. */
  30. public function list(int $goodsId)
  31. {
  32. $model = new ServiceModel;
  33. $list = $model->getListByGoods($goodsId);
  34. return $this->renderSuccess(compact('list'));
  35. }
  36. }