打开 /admin/includes/lib_goods.php,找到check_goods_specifications_exist函数。
修改为如下内容(注,加了一句: AND a.attr_type = 1";)
/**
* 检查单个商品是否存在规格
*
* @param int $goods_id 商品id
* @return bool true,存在;false,不存在
*/
function check_goods_specifications_exist($goods_id)
{
$goods_id = intval($goods_id);
$sql = "SELECT COUNT(a.attr_id)
FROM " .$GLOBALS['ecs']->table('attribute'). " AS a, " .$GLOBALS['ecs']->table('goods'). " AS g
WHERE a.cat_id = g.goods_type
AND g.goods_id = '$goods_id'
AND a.attr_type = 1";
$count = $GLOBALS['db']->getOne($sql);
if ($count > 0)
{
return true; //存在
}
else
{
return false; //不存在
}
}