phpweb商城模块,在后台发布商品的时候,会员价格 无法根据会员类型就行自动生成。分析其代码是由于
shop admin post.php导致的
shopadd :::::
if ( $memberprice != "" && is_array( $memberprice ) )
{
while ( list( $key, $val ) = each($memberprice) )
{
$msql->query( "insert into {P}_shop_memberprice set `price`='{$val}',`membertypeid`='{$key}',`gid`='{$gid}'" );
}
}
shopmod:::
if ( $memberprice != "" && is_array( $memberprice ) )
{
while ( list( $key, $val ) = each($memberprice) )
{
$msql->query( "select id from {P}_shop_memberprice where `membertypeid`='{$key}' and `gid`='{$id}' limit 0,1" );
if ( $msql->next_record( ) )
{
$fsql->query( "update {P}_shop_memberprice set `price`='{$val}' where `membertypeid`='{$key}' and `gid`='{$id}'" );
}
else
{
$fsql->query( "insert into {P}_shop_memberprice set `price`='{$val}',`membertypeid`='{$key}',`gid`='{$id}'" );
}
}
}