Commit 6279371e by xmy

feat:获取商品(包括已删除)

parent 991bbca1
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
namespace Hdll\Services\Goods\Lib; namespace Hdll\Services\Goods\Lib;
use App\Exception\ServiceException;
use Swoft\Core\ResultInterface; use Swoft\Core\ResultInterface;
/** /**
...@@ -25,127 +26,128 @@ use Swoft\Core\ResultInterface; ...@@ -25,127 +26,128 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferAdminCountActivity($storeId) * @method ResultInterface deferAdminCountActivity($storeId)
* @method ResultInterface deferGetTopThreeSales($storeId) * @method ResultInterface deferGetTopThreeSales($storeId)
* @method ResultInterface deferGetReturnVisitByGoodsIds($storeId, $goodsIds) * @method ResultInterface deferGetReturnVisitByGoodsIds($storeId, $goodsIds)
* @method ResultInterface deferCountEvaluate($storeId,$time) * @method ResultInterface deferCountEvaluate($storeId, $time)
* @method ResultInterface deferFind($storeId, $id)
* Interface GoodsInterface * Interface GoodsInterface
* @package Hdll\Services\Goods\Lib * @package Hdll\Services\Goods\Lib
*/ */
interface GoodsInterface interface GoodsInterface
{ {
/** /**
* 获取商品 * 获取商品
* @param $storeId * @param $storeId
* @return [ * @param $id
* 'gcId' 商品类ID * @return [
* 'asId' 服务ID * 'gcId' 商品类ID
* 'stock' 库存 * 'asId' 服务ID
* 'name' 名称 * 'stock' 库存
* 'image' 图片 * 'name' 名称
* 'price' 价格 * 'image' 图片
* 'state' 状态 * 'price' 价格
* 'body' 描述 * 'state' 状态
* 'originalPrice' 原价 * 'body' 描述
* 'sales' 销量 * 'originalPrice' 原价
* ] * 'sales' 销量
* @param $id * ]
* @return mixed * @return mixed
* @author Administrator * @author Administrator
*/ */
public function get($storeId, $id); public function get($storeId, $id);
/** /**
* 增加商品销量 * 增加商品销量
* 减少商品库存 * 减少商品库存
* @param $storeId * @param $storeId
* @param $goodsId * @param $goodsId
* @return mixed * @return mixed
* @author Administrator * @author Administrator
*/ */
public function incSales($storeId, $goodsId); public function incSales($storeId, $goodsId);
/** /**
* 减少商品销量 * 减少商品销量
* 增加商品库存 * 增加商品库存
* @param $storeId * @param $storeId
* @param $goodsId * @param $goodsId
* @return mixed * @return mixed
* @author Administrator * @author Administrator
*/ */
public function decSales($storeId, $goodsId); public function decSales($storeId, $goodsId);
/** /**
* 获取商品服务 * 获取商品服务
* @param $storeId * @param $storeId
* @param $goodsId * @param $goodsId
* @param $type 1 付款后 2 服务前 3 服务后 * @param $type 1 付款后 2 服务前 3 服务后
* @return mixed * @return mixed
* @author Administrator * @author Administrator
*/ */
public function getServiceByGoodsId($storeId, $goodsId, $type = 3); public function getServiceByGoodsId($storeId, $goodsId, $type = 3);
/** /**
* 获取用户回访 * 获取用户回访
* @param $storeId * @param $storeId
* @param $goodsId * @param $goodsId
* @param $type 1 之前 2 之后 * @param $type 1 之前 2 之后
* @return mixed * @return mixed
* @author Administrator * @author Administrator
*/ */
public function getReturnVisitByGoodsId($storeId, $goodsId, $type = 2); public function getReturnVisitByGoodsId($storeId, $goodsId, $type = 2);
/** /**
* 获取商品列表 ids * 获取商品列表 ids
* @param $ids * @param $ids
* @param $storeId * @param $storeId
* @param $order * @param $order
* @return mixed * @return mixed
* @author Administrator * @author Administrator
*/ */
public function listByIds(array $ids, $storeId, $order = ['id', 'DESC']); public function listByIds(array $ids, $storeId, $order = ['id', 'DESC']);
/** /**
* 获取sku信息 * 获取sku信息
* @param $skuId * @param $skuId
* @param $goodsId * @param $goodsId
* @param $storeId * @param $storeId
* @return mixed * @return mixed
* @author work * @author work
*/ */
public function getSkuInfo($skuId, $goodsId, $storeId); public function getSkuInfo($skuId, $goodsId, $storeId);
/** /**
* 获取多个sku信息 * 获取多个sku信息
* @param $goodsId * @param $goodsId
* @param $skuIds * @param $skuIds
* @return mixed * @return mixed
* @author work * @author work
*/ */
public function getSkuByIds($goodsId, $skuIds, $storeId); public function getSkuByIds($goodsId, $skuIds, $storeId);
public function getSkuByGoodsId($goodsId, $storeId); public function getSkuByGoodsId($goodsId, $storeId);
/** /**
* 获取商品规格属性 * 获取商品规格属性
* @param $goodsId * @param $goodsId
* @param $storeId * @param $storeId
* @return mixed * @return mixed
* @author work * @author work
*/ */
public function getSpecAttributeByGoodsId($goodsId, $storeId); public function getSpecAttributeByGoodsId($goodsId, $storeId);
/** /**
* 添加后续服务模版 * 添加后续服务模版
* @param $storeId * @param $storeId
* @return mixed * @return mixed
* @author work * @author work
*/ */
public function afterServiceTmp($storeId); public function afterServiceTmp($storeId);
/** /**
* 获取商品数量 * 获取商品数量
...@@ -177,4 +179,11 @@ interface GoodsInterface ...@@ -177,4 +179,11 @@ interface GoodsInterface
*/ */
public function getReturnVisitByGoodsIds($storeId, $goodsIds); public function getReturnVisitByGoodsIds($storeId, $goodsIds);
/**
* 获取商品(包括已删除)
* @param $storeId
* @param $id
* @return array|mixed
*/
public function find($storeId, $id);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment