首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >VirtueMart搜索误差

VirtueMart搜索误差
EN

Stack Overflow用户
提问于 2016-02-26 21:31:22
回答 1查看 202关注 0票数 0

因此,在更新Virtuemart之后,当我在客户站点上查找特定产品时,我会收到这个错误:

vmError:在where子句中exeSortSearchListQuery未知列'p.product_sku‘

代码语言:javascript
复制
SQL=SELECT SQL_CALC_FOUND_ROWS p.`virtuemart_product_id` 
FROM `tqmux_virtuemart_products` as p 
INNER JOIN `tqmux_virtuemart_products_en_gb` as l 
  using (`virtuemart_product_id`) 
LEFT JOIN `tqmux_virtuemart_product_manufacturers` 
   ON p.`virtuemart_product_id` = `tqmux_virtuemart_product_manufacturers`.`virtuemart_product_id` 
WHERE ((`l`.product_name LIKE "%anya%" 
        OR `product_sku` LIKE "%anya%" 
        OR `l`.`slug` LIKE "%anya%" 
        OR `l`.product_s_desc LIKE "%anya%" 
        OR `l`.`metadesc` LIKE "%anya%" 
        OR `p.product_sku` LIKE "%anya%" 
        OR `c.category_name` LIKE "%anya%" 
        OR `c.category_description` LIKE "%anya%" 
        OR `m.mf_name` LIKE "%anya%" 
        OR `p.product_name` LIKE "%anya%" 
        OR `p.product_s_desc` LIKE "%anya%") 
   AND `tqmux_virtuemart_product_manufacturers`.`virtuemart_manufacturer_id` = 1    
   AND p.`virtuemart_vendor_id` = "1" ) 
 group by p.`virtuemart_product_id` 
 ORDER BY p.`created_on` DESC, `virtuemart_product_id` DESC 
 LIMIT 0, 20

有谁可以帮我?谢谢。

更新

EN

回答 1

Stack Overflow用户

发布于 2016-03-14 17:20:45

我一般只在必要的时候才使用回溯词。例如在列名或保留字列名中的空格上,否则为了可读性而将它们排除在外,因此您不会遇到这些类型的错误。

代码语言:javascript
复制
`p.product_sku` 

 should be

`p`.`product_sku`

所以..。

代码语言:javascript
复制
SELECT SQL_CALC_FOUND_ROWS p.virtuemart_product_id
FROM tqmux_virtuemart_products as p 
INNER JOIN tqmux_virtuemart_products_en_gb as l 
  using (virtuemart_product_id) 
LEFT JOIN tqmux_virtuemart_product_manufacturers tvpm
   ON p.virtuemart_product_id = tvpm.virtuemart_product_id
WHERE ((l.product_name LIKE "%anya%" 
        OR product_sku LIKE "%anya%"   
        OR l.slug LIKE "%anya%" 
        OR l`.product_s_desc LIKE "%anya%" 
        OR l`.`metadesc LIKE "%anya%" 
        OR p.product_sku LIKE "%anya%" 
        OR c.category_name LIKE "%anya%" 
        OR c.category_description LIKE "%anya%" 
        OR m.mf_name LIKE "%anya%" 
        OR p.product_name LIKE "%anya%" 
        OR p.product_s_desc LIKE "%anya%") 
   AND tvpm.virtuemart_manufacturer_id = 1    
   AND p.virtuemart_vendor_id = "1" ) 
 group by p.virtuemart_product_id 
 ORDER BY p.created_on DESC, virtuemart_product_id DESC 

我也想知道为什么

代码语言:javascript
复制
            OR p.product_sku LIKE "%anya%" 
and         OR product_sku LIKE "%anya%" 

都在查询中。他们似乎也在做同样的事情。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35662135

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档