|
|
@@ -39,9 +39,9 @@ class ProductClass extends BaseClass
|
|
|
const LOCK_CHECK_STOCK = 'lock_check_stock'; //判断库存
|
|
|
|
|
|
//根据itemIds获取相应的花材信息
|
|
|
- public static function getProductInfoByItemIds(array $itemIds, $shopId)
|
|
|
+ public static function getProductInfoByItemIds(array $itemIds, $hdMainId)
|
|
|
{
|
|
|
- $where = ['itemId' => ['in', $itemIds], 'delStatus' => 0, 'shopId' => $shopId];
|
|
|
+ $where = ['itemId' => ['in', $itemIds], 'delStatus' => 0, 'mainId' => $hdMainId];
|
|
|
$data = self::getAllList('*', $where);
|
|
|
$data = self::groupItemBaseInfo($data);
|
|
|
return $data;
|
|
|
@@ -964,13 +964,13 @@ class ProductClass extends BaseClass
|
|
|
|
|
|
//供应商的productId => 零售端的productId ,不存在的补productId(放在默认分类)
|
|
|
//productList [{"productId":"113","bigNum":1,"smallNum":0,"classId":"-2","itemId":1}]
|
|
|
- public static function toggleProductList($productList, $hdShopId, $hdSjId)
|
|
|
+ public static function toggleProductList($productList, $hdShopId, $hdSjId, $hdMainId)
|
|
|
{
|
|
|
$itemIds = array_column($productList, "itemId");
|
|
|
- $hdProductData = self::getProductInfoByItemIds($itemIds, $hdShopId);
|
|
|
+ $hdProductData = self::getProductInfoByItemIds($itemIds, $hdMainId);
|
|
|
$hdProductData = array_column($hdProductData, null, "itemId");
|
|
|
//获取默认分类ID
|
|
|
- $defaultClassId = ItemClassClass::getDefaultClassId($hdSjId);
|
|
|
+ $defaultClassId = ItemClassClass::getDefaultClassId($hdMainId);
|
|
|
|
|
|
foreach ($productList as $k => $v) {
|
|
|
$itemId = $v['itemId'] ?? 0;
|
|
|
@@ -982,6 +982,7 @@ class ProductClass extends BaseClass
|
|
|
$productData = $ptItem;
|
|
|
$productData['sjId'] = $hdSjId;
|
|
|
$productData['shopId'] = $hdShopId;
|
|
|
+ $productData['mainId'] = $hdMainId;
|
|
|
$productData['itemId'] = $itemId;
|
|
|
$productData['classId'] = $defaultClassId;
|
|
|
unset($productData['id']);
|