您的位置:首页 > 运维架构

ecshop模板新添商品 此商品不存在规格,请为其添加规格 的解决方法

2011-06-15 09:48 330 查看
打开 /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; //不存在

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: