修复商品规格列之间重复导致数据混乱,PC规格整数类型bug修复

This commit is contained in:
gongfuxiang 2019-01-14 01:08:02 +08:00
parent 7e66774174
commit 92689aedca
2 changed files with 12 additions and 3 deletions

View File

@ -1141,11 +1141,12 @@ class GoodsService
}
if(!empty($temp_column))
{
return DataReturn('规格值列直接不能重复['.implode(',', array_unique($temp_column)).']', -1);
return DataReturn('规格值列之间不能重复['.implode(',', array_unique($temp_column)).']', -1);
}
}
// 规格名称
$names_value = [];
$names = array_slice($data[0], 0, $count);
foreach($names as $v)
{
@ -1162,12 +1163,20 @@ class GoodsService
'name' => $params['specifications_name_'.$key],
'value' => array_unique($vs),
];
$names_value[] = $params['specifications_name_'.$key];
}
}
}
}
}
// 规格名称列直接是否存在重复
$unique_all = array_unique($names_value);
$repeat_names_all = array_diff_assoc($names_value, $unique_all);
if(!empty($repeat_names_all))
{
return DataReturn('规格名称列之间不能重复['.implode(',', $repeat_names_all).']', -1);
}
} else {
if(empty($data[0][0]) || $data[0][0] <= 0)
{

View File

@ -241,7 +241,7 @@ function GoodsSpecType()
$('.theme-signin-left .sku-items').eq(index).find('li').each(function(k, v)
{
$(this).removeClass('sku-dont-choose');
var value = $(this).data('value');
var value = $(this).data('value').toString();
if(result.data.indexOf(value) == -1)
{
$(this).addClass('sku-items-disabled');