Array ( [errno] => 1064
2016-07-07 15:51 来源:www.chinab4c.com 作者:ecshop专家
修复了`ecs_link_goods`等很多表,修复成功了,但还是不行 重启服务器也不行 |
回答:
请高手指点 |
这个应该是SQL语句的问题,楼上的没修改过代码吧? |
一点都没修过,用的是默认模板 |
那你肯定修改过数据库了 |
请高手搞定的,公布如下以方便遇到同样问题者: 改的地方是根目录下goods.php文件的get_linked_goods函数 第229行 之前是"LIMIT " . $GLOBALS['_CFG']['related_goods_number']; 如果related_goods_number为空的话,就会报错 这里增加了一个判断,对不同情况进行不同的处理 原来的代码: * 获得指定商品的关联商品 * * @accesspublic * @paraminteger$goods_id * @returnarray */ function get_linked_goods($goods_id) { $sql = 'SELECT g.goods_id, g.goods_name, g.goods_thumb, g.goods_img, g.shop_price AS org_price, ' . "IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, ". 'g.market_price, g.promote_price, g.promote_start_date, g.promote_end_date ' . 'FROM ' . $GLOBALS['ecs']->table('link_goods') . ' lg ' . 'LEFT JOIN ' . $GLOBALS['ecs']->table('goods') . ' AS g ON g.goods_id = lg.link_goods_id ' . "LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp ". "ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' ". "WHERE lg.goods_id = '$goods_id' AND g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0 ". "LIMIT " . $GLOBALS['_CFG']['related_goods_number']; $res = $GLOBALS['db']->query($sql); 改后的代码: * 获得指定商品的关联商品 * * @accesspublic * @paraminteger$goods_id * @returnarray */ function get_linked_goods($goods_id) { $sql = 'SELECT g.goods_id, g.goods_name, g.goods_thumb, g.goods_img, g.shop_price AS org_price, ' . "IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, ". 'g.market_price, g.promote_price, g.promote_start_date, g.promote_end_date ' . 'FROM ' . $GLOBALS['ecs']->table('link_goods') . ' lg ' . 'LEFT JOIN ' . $GLOBALS['ecs']->table('goods') . ' AS g ON g.goods_id = lg.link_goods_id ' . "LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp ". "ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' ". "WHERE lg.goods_id = '$goods_id' AND g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0 "; $sql .= $GLOBALS['_CFG']['related_goods_number'] ? " LIMIT " . $GLOBALS['_CFG']['related_goods_number'] : ''; $res = $GLOBALS['db']->query($sql); |
呵呵,楼主过奖了 这个问题是因为没有在后台设置关联商品的数量而导致的。 然而程序这里没有对“关联商品设置为空”的条件进行判断,所以导致的这个问题。 |
最近更新
常用插件
- ecshop会员中心订单excel倒出
ecshop会员中心订单excel倒出...
- ecshop注册推荐送现金插件
ecshop中的促销售功能还不是很完善,随着电子商务系统的发展和进步,...
- ecshop二次开发商品购买备
ecshop销售统计 插件介绍:ecshop二次开发订单销售统计和商品购买备注服...
- ecshop2.7.2退换货申请插件
ecshop2.7.2退换货申请插件,主要是在 ecshop 现在的基础上,对ecshop的订单处...
- ecshop二次商品订购人信息
ecshop二次商品订购人信息填写插件,有时候给朋友送花,或者是送礼品的...
ecshop热门问答
ecshop热门资料
ecshop不见
ecshop商品属性筛选
ecshopignore
ecshop领取
ecshop做网站
ecshopECSHOP升级
ecshop种类
ecshop公告设置
ecshop免费版
ecshop后台管理员
ecshop添加分类
ecshopBlueocean
ecshop时尚
ecshop不能不
ecshop衣裙
ecshopectianjiao
ecshop后台不能上传图片
ecshop发布日期
ecshophome
ecshop复位
ecshop一窍不通
ecshop女鞋
ecshomysqlrepair
ecshophistory
ecshopGenerator
ecshop单按钮
ecshopthumb
ecshop特别
ecshop显示商品数量
ecshop报价单