后台使用搜索问题

问题咨询 · cqslxz · 于 5年前 发布 · 1412 次阅读

你好,我想在想在后台使用appserver 里面的/catalogsearch/index/product 的搜索功能,现在我把indexcontroller拷了过来,但是使用时无论搜索什么关键词都没搜索结果数据返回。我看了下 关键词这些都接收到了的,在services的search.php中

    protected function actionGetSearchProductColl($select, $where, $pageNum, $numPerPage, $product_search_max_count, $filterAttr = [])
    {
        $currentLangCode = Yii::$service->store->currentLangCode;

        if (!$currentLangCode) {
            return;
        }
        $searchEngineList = $this->getAllChildServiceName();
        if (is_array($searchEngineList) && !empty($searchEngineList)) {
            foreach ($searchEngineList as $sE) {
                $service = $this->{$sE};
                $searchLang = $service->searchLang;
                if (is_array($searchLang) && !empty($searchLang)) {
                    $searchLangCode = array_keys($searchLang);
                    // 如果当前store的语言,在当前的搜索引擎中支持,则会使用这个搜索,作为支持。

                    if (in_array($currentLangCode, $searchLangCode)) {
                        return $service->getSearchProductColl($select, $where, $pageNum, $numPerPage, $product_search_max_count, $filterAttr);
                    }
                }
            }
        }
    }

$currentLangCode = Yii::$service->store->currentLangCode;这行currentLangCode没有都到,请问下这要配置什么参数?谢谢

共收到 1 条回复 问题提问
Fecmall#15年前 0 个赞

目前的这部分实现是针对前端的

后端如何要用这个搜索,是不行的,参考一下自己开发把

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics