You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.6 KiB

  1. <?php
  2. namespace App\Service\v3\Implementations;
  3. use App\Service\v3\Interfaces\GoodsServiceInterface;
  4. use Hyperf\DbConnection\Db;
  5. class GoodsService implements GoodsServiceInterface
  6. {
  7. public function detail()
  8. {
  9. /*
  10. * 返回商品 封面图
  11. * * 返回商品 轮播图
  12. * 返回商品信息 包括名称 规格 tag等
  13. * 返回店铺信息
  14. * 返回商品规格信息
  15. * 猜你喜欢
  16. * 限时抢购
  17. * 为你推荐
  18. * */
  19. $goods['detail'] = Db::table('lanzu_goods')->where('id',170)->get();
  20. $goods['banner'] = $this->getBanner();
  21. $goods['spec'] = $this->getSpec();
  22. return $goods;
  23. }
  24. public function getBanner()
  25. {
  26. $banner = [
  27. [
  28. 'id' => 1,
  29. 'type' => 1,
  30. 'path' => 'https://img.lanzu.vip/static/img/dic_banners/dic_banner_0.jpg'
  31. ],
  32. [
  33. 'id' => 2,
  34. 'type' => 1,
  35. 'path' => 'https://img.lanzu.vip/static/img/dic_banners/dic_banner_1.jpg'
  36. ]
  37. ];
  38. return $banner;
  39. }
  40. public function getSpec()
  41. {
  42. $spec = [
  43. [
  44. '净含量' => '约500G',
  45. '保存条件' => '常温',
  46. '保质期' => '10天'
  47. ]
  48. ];
  49. return $spec;
  50. }
  51. public function do()
  52. {
  53. // TODO: Implement do() method.
  54. }
  55. public function check($goodsId)
  56. {
  57. // TODO: Implement check() method.
  58. }
  59. public function undo()
  60. {
  61. // TODO: Implement undo() method.
  62. }
  63. }