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.

88 lines
2.8 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['detail'] = Db::table('lanzu_goods')->where('id',35)->get();
  50. $goods['banner'] = $this->getBanner();
  51. return $goods;
  52. }
  53. public function getBanner()
  54. {
  55. $banner = [
  56. [
  57. 'id' => 1,
  58. 'type' => 1,
  59. 'path' => 'https://img.lanzu.vip/static/img/dic_banners/dic_banner_0.jpg'
  60. ],
  61. [
  62. 'id' => 2,
  63. 'type' => 1,
  64. 'path' => 'https://img.lanzu.vip/static/img/dic_banners/dic_banner_1.jpg'
  65. ]
  66. ];
  67. return $banner;
  68. }
  69. public function do()
  70. {
  71. // TODO: Implement do() method.
  72. }
  73. public function check($goodsId)
  74. {
  75. // TODO: Implement check() method.
  76. }
  77. public function undo()
  78. {
  79. // TODO: Implement undo() method.
  80. }
  81. }