|
|
@@ -1079,6 +1079,7 @@ class ProductRepository extends BaseRepository
|
|
|
$mer_cat = array_column($data['merCateId']->toArray(), 'mer_cate_id') ;
|
|
|
}
|
|
|
$data['mer_cate_id'] = $mer_cat;
|
|
|
+ @file_put_contents('quanju.txt',"-测试3\r\n",8);
|
|
|
foreach ($data['attr'] as $k => $v) {
|
|
|
$data['attr'][$k] = ['value' => $v['attr_name'], 'detail' => $v['attr_values']];
|
|
|
}
|
|
|
@@ -1087,7 +1088,7 @@ class ProductRepository extends BaseRepository
|
|
|
$arr = [];
|
|
|
if (in_array($data['product_type'], [1, 3])) $value_make = app()->make(ProductAttrValueRepository::class);
|
|
|
$attrValue = json_decode(json_encode($attrValue,true),true);
|
|
|
-
|
|
|
+ @file_put_contents('quanju.txt',"-测试4\r\n",8);
|
|
|
foreach ($attrValue as $key => $item) {
|
|
|
if ($data['product_type'] == 1) {
|
|
|
$value = $value_make->getSearch(['sku' => $item['sku'], 'product_id' => $data['old_product_id']])->find();
|
|
|
@@ -1114,6 +1115,7 @@ class ProductRepository extends BaseRepository
|
|
|
$sku = explode(',', $item['sku']);
|
|
|
$item['old_stock'] = $old_stock ?? $item['stock'];
|
|
|
if (isset($item['productCdkey']) && count($item['productCdkey'])) {
|
|
|
+ @file_put_contents('quanju.txt',"-测试5\r\n",8);
|
|
|
foreach ($item['productCdkey'] as $hasCdkey) {
|
|
|
if ($hasCdkey['is_type']) {
|
|
|
$cdkey['list'][] = $hasCdkey;
|
|
|
@@ -1125,6 +1127,7 @@ class ProductRepository extends BaseRepository
|
|
|
$item['cdkey'] = $cdkey;
|
|
|
}
|
|
|
unset($item['productCdkey']);
|
|
|
+ @file_put_contents('quanju.txt',"-测试6\r\n",8);
|
|
|
foreach ($sku as $k => $v) { $item['value' . $k] = $v; }
|
|
|
if ($is_copy) {$item['library_id'] = 0;$item['stock'] = 0;}
|
|
|
$arr[] = $item;
|