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.

72 lines
2.4 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'] = [
  20. "id" => 170,
  21. "market_id" => 2,
  22. "store_id" => 39,
  23. "goods_type_id" => 39,
  24. "on_sale" => 1,
  25. "sort" => 0,
  26. "is_infinite" => 2,
  27. "start_num" => 0,
  28. "restrict_num" => 0,
  29. "inventory" => 1000,
  30. "name" => "冬菜",
  31. "cover_img" => "https => //store.lanzu.vip/attachment/images/2/2020/06/en2nQYncqN4f44qnA7CwnNOG2WqQ2q.jpg",
  32. "price" => "2.50",
  33. "original_price" => "2.50",
  34. "vip_price" => "0.00",
  35. "sales" => 0,
  36. "good_unit" => "",
  37. "tags" => null,
  38. "details_imgs" => null,
  39. "spec" => null,
  40. "content" => "",
  41. "details" => "<p><img src=\"https => //store.lanzu.vip/attachment/images/2/2020/06/J1Z5N818NqCt581LF1V1Tqd88151fV.jpg\" _src=\"https => //store.lanzu.vip/attachment/images/2/2020/06/J1Z5N818NqCt581LF1V1Tqd88151fV.jpg\" alt=\"冬菜.jpg\" style=\"max-width => 100%\"></p><p>​<br></p>",
  42. "created_at" => null,
  43. "updated_at" => 1598769782,
  44. "deleted_at" => null,
  45. '净含量' => '约500G',
  46. '保存条件' => '常温',
  47. '保质期' => '10天'
  48. ];
  49. $goods['banner'] = $this->getBanner();
  50. return $goods;
  51. }
  52. public function getBanner()
  53. {
  54. $banner = [
  55. [
  56. 'id' => 1,
  57. 'type' => 1,
  58. 'path' => 'https://img.lanzu.vip/static/img/dic_banners/dic_banner_0.jpg'
  59. ],
  60. [
  61. 'id' => 2,
  62. 'type' => 1,
  63. 'path' => 'https://img.lanzu.vip/static/img/dic_banners/dic_banner_1.jpg'
  64. ]
  65. ];
  66. return $banner;
  67. }
  68. }