ecshop二次开发 购物车添加商品限制如果购物车里有1元商品则不能继续添加购物车
$sql_where111=$_SESSION['user_id']>0?"user_id='".$_SESSION['user_id']."'":"session_id...
$sql_where111 = $_SESSION['user_id']>0 ? "user_id='". $_SESSION['user_id'] ."' " : "session_id = '" . SESS_ID . "' AND user_id=0 ";
$sql111 = mysql_query("SELECT COUNT(*) FROM " . $ecs->table('cart') ." WHERE $sql_where111 " ." AND goods_price =1");
$sql123 = mysql_fetch_array($sql111);
if (!empty$sql123) {
$result['error'] = 888;
$result['message'] = "特价商品每次限购一单!";
die($json->encode($result));
}
我写的代码 运行出错,无论有没有一元商品都提示不能购买。菜鸟新手,大神误笑啊 展开
$sql111 = mysql_query("SELECT COUNT(*) FROM " . $ecs->table('cart') ." WHERE $sql_where111 " ." AND goods_price =1");
$sql123 = mysql_fetch_array($sql111);
if (!empty$sql123) {
$result['error'] = 888;
$result['message'] = "特价商品每次限购一单!";
die($json->encode($result));
}
我写的代码 运行出错,无论有没有一元商品都提示不能购买。菜鸟新手,大神误笑啊 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询