商品类型加了一个字段

2016-07-07 15:01 来源:www.chinab4c.com 作者:ecshop专家

一。ec_goods_attr表 加了一个字段 attr_istype
二.admin/include/lib_goods.php 大改713行
$html .= ($val['attr_type'] == 1 || $val['attr_type'] == 2) ?
$GLOBALS['_LANG']['spec_price'].' <input type="text" name="attr_price_list[]" value="' . $val['attr_price'] . '" size="5" maxlength="10" />' :
' <input type="hidden" name="attr_price_list[]" value="0" />';
下面增加了下面代码
$html .= '<input type="text" name="attr_istype[]" id="attr_istype_'.$val['goods_attr_id'].'" value="'.$val['attr_istype'].'">'; 三。在admin/goods.php
$goods_attr_list[$attr_id][$attr_value]['attr_price'] = $attr_price;
下面增加了下面代码
$goods_attr_list[$attr_id][$attr_value]['attr_istype'] = $attr_istype;


/* 插入、更新、删除数据 */
foreach ($goods_attr_list as $attr_id => $attr_value_list)
{
foreach ($attr_value_list as $attr_value => $info)
{

if ($info['sign'] == 'insert')
{
$sql = "INSERT INTO " .$ecs->table('goods_attr'). " (attr_id, goods_id, attr_value, attr_price, attr_istype)".
"VALUES ('$attr_id', '$goods_id', '$attr_value', '$info[attr_price]', '$info[attr_istype]')";
}
elseif ($info['sign'] == 'update')
{
$sql = "UPDATE " .$ecs->table('goods_attr'). " SET attr_price = '$info[attr_price]',attr_istype = '$info[attr_istype]' WHERE goods_attr_id = '$info[goods_attr_id]' LIMIT 1";

}
else
{
$sql = "DELETE FROM " .$ecs->table('goods_attr'). " WHERE goods_attr_id = '$info[goods_attr_id]' LIMIT 1";
}
$db->query($sql);
}
红色的attr_istype = '$info[attr_istype]'怎么更新不到啊 是不是那里出错 了希望大家帮忙解决