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.
74 lines
2.6 KiB
74 lines
2.6 KiB
<?php
|
|
|
|
namespace App\Service\v3\Implementations;
|
|
|
|
use App\Service\v3\Interfaces\GoodsServiceInterface;
|
|
use Hyperf\DbConnection\Db;
|
|
|
|
class GoodsService implements GoodsServiceInterface
|
|
{
|
|
public function detail()
|
|
{
|
|
/*
|
|
* 返回商品 封面图
|
|
* * 返回商品 轮播图
|
|
* 返回商品信息 包括名称 规格 tag等
|
|
* 返回店铺信息
|
|
* 返回商品规格信息
|
|
* 猜你喜欢
|
|
* 限时抢购
|
|
* 为你推荐
|
|
* */
|
|
// $goods['detail'] = [
|
|
// "id" => 170,
|
|
// "market_id" => 2,
|
|
// "store_id" => 39,
|
|
// "goods_type_id" => 39,
|
|
// "on_sale" => 1,
|
|
// "sort" => 0,
|
|
// "is_infinite" => 2,
|
|
// "start_num" => 0,
|
|
// "restrict_num" => 0,
|
|
// "inventory" => 1000,
|
|
// "name" => "冬菜",
|
|
// "cover_img" => "https => //store.lanzu.vip/attachment/images/2/2020/06/en2nQYncqN4f44qnA7CwnNOG2WqQ2q.jpg",
|
|
// "price" => "2.50",
|
|
// "original_price" => "2.50",
|
|
// "vip_price" => "0.00",
|
|
// "sales" => 0,
|
|
// "good_unit" => "",
|
|
// "tags" => null,
|
|
// "details_imgs" => null,
|
|
// "spec" => null,
|
|
// "content" => "",
|
|
// "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>",
|
|
// "created_at" => null,
|
|
// "updated_at" => 1598769782,
|
|
// "deleted_at" => null,
|
|
// '净含量' => '约500G',
|
|
// '保存条件' => '常温',
|
|
// '保质期' => '10天'
|
|
// ];
|
|
$goods['detail'] = Db::table('lanzu_goods')->where('id',35)->get();
|
|
$goods['banner'] = $this->getBanner();
|
|
return $goods;
|
|
}
|
|
|
|
public function getBanner()
|
|
{
|
|
$banner = [
|
|
[
|
|
'id' => 1,
|
|
'type' => 1,
|
|
'path' => 'https://img.lanzu.vip/static/img/dic_banners/dic_banner_0.jpg'
|
|
],
|
|
[
|
|
'id' => 2,
|
|
'type' => 1,
|
|
'path' => 'https://img.lanzu.vip/static/img/dic_banners/dic_banner_1.jpg'
|
|
]
|
|
];
|
|
return $banner;
|
|
}
|
|
|
|
}
|