全部
常见问题
产品动态
精选推荐

PRO3.2 商品搜索记录修复

管理 管理 编辑 删除

1,文件地址:app/services/product/product/StoreProductServices.php

注释代码放开,如下图:

方法名:getGoodsList

590bb20250317102828867.png

2,文件地址:app/controller/api/v1/product/StoreProduct.php

方法名:lst

替换此方法

public function lst(Request $request, StoreProductCategoryServices $services)
    {
        $where = $request->getMore([
            [['sid', 'd'], 0],
            [['cid', 'd'], 0],
            [['tid', 'd'], 0],
            ['keyword', '', '','store_name'],
            ['priceOrder', ''],
            ['salesOrder', ''],
            ['defaultOrder', ''],
            [['news', 'd'], 0, '', 'is_new'],
            [['type', ''], '', '', 'status'],
            ['ids', ''],
            [['selectId', 'd'], ''],
            ['cate_id', ''],
            ['productId', ''],
            ['brand_id', ''],
            ['promotions_id', 0],
            ['promotions_type', 0],
            ['store_label_id', 0],
            ['is_big', 0],//是否大图模式
        ]);
        if ($where['selectId'] && (!$where['sid'] || !$where['cid'])) {
            $level = $services->value(['id' => (int)$where['selectId']], 'level') ?? 0;
            $levelArr = $services->cateField;
            $where[$levelArr[$level] ?? 'cid'] = $where['selectId'];
        }
        $where['ids'] = stringToIntArray($where['ids']);
        if (!$where['ids']) {
            unset($where['ids']);
        }
        $where['brand_id'] = stringToIntArray($where['brand_id']);
        $where['store_label_id'] = stringToIntArray($where['store_label_id']);

        $cateId = $where['cate_id'];
        if ($cateId) {
            $cateId = is_string($cateId) ? stringToIntArray($where['cate_id']) : $cateId;
            $cateId = array_merge($cateId, $services->getColumn(['pid' => $cateId], 'id'));
            $cateId = array_unique(array_diff($cateId, [0]));
        }
        $where['cate_id'] = $cateId;

        $type = $where['is_big'] ? 'big' : 'mid';
        unset($where['is_big']);
        $field = ['image', 'recommend_image'];
        if ($where['store_name']) {//搜索
            $field = ['image'];
            $where['pid'] = 0;
        }
        $list = $this->services->getGoodsList($where, (int)$request->uid(), (int)$where['promotions_type']);
        return app('json')->successful(get_thumb_water($list, $type, $field));
    }


请登录后查看

刘松林 最后编辑于2025-03-18 09:51:12

快捷回复
回复
回复
回复({{post_count}}) {{!is_user ? '我的回复' :'全部回复'}}
排序 默认正序 回复倒序 点赞倒序

{{item.user_info.nickname ? item.user_info.nickname : item.user_name}} LV.{{ item.user_info.bbs_level }}

作者 管理员 企业

{{item.floor}}# 同步到gitee 已同步到gitee {{item.is_suggest == 1? '取消推荐': '推荐'}}
{{item.is_suggest == 1? '取消推荐': '推荐'}}
沙发 板凳 地板 {{item.floor}}#
{{item.user_info.title || '暂无简介'}}
附件

{{itemf.name}}

{{item.created_at}}  {{item.ip_address}}
{{item.like_count}}
{{item.showReply ? '取消回复' : '回复'}}
删除
回复
回复

{{itemc.user_info.nickname}}

{{itemc.user_name}}

回复 {{itemc.comment_user_info.nickname}}

附件

{{itemf.name}}

{{itemc.created_at}}
{{itemc.like_count}}
{{itemc.showReply ? '取消回复' : '回复'}}
删除
回复
回复
查看更多
449
{{like_count}}
{{collect_count}}
添加回复 ({{post_count}})

相关推荐

快速安全登录

使用微信扫码登录
{{item.label}} 加精
{{item.label}} {{item.label}} 板块推荐 常见问题 产品动态 精选推荐 首页头条 首页动态 首页推荐
取 消 确 定
回复
回复
问题:
问题自动获取的帖子内容,不准确时需要手动修改. [获取答案]
答案:
提交
bug 需求 取 消 确 定

微信登录/注册

切换手机号登录

{{ bind_phone ? '绑定手机' : '手机登录'}}

{{codeText}}
切换微信登录/注册
暂不绑定
CRMEB客服

CRMEB咨询热线 咨询热线

400-8888-794

微信扫码咨询

CRMEB开源商城下载 源码下载 CRMEB帮助文档 帮助文档
返回顶部 返回顶部
CRMEB客服