From 7f2cf94e8850c00bc6ec32960819473925a39e30 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Thu, 8 Jun 2023 18:28:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=8F=AF=E4=BB=A5=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=B8=80=E7=BA=A7=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/dao/product/product/StoreProductDao.php | 2 +- .../services/product/product/StoreCategoryServices.php | 10 +++++----- .../services/product/product/StoreProductServices.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crmeb/app/dao/product/product/StoreProductDao.php b/crmeb/app/dao/product/product/StoreProductDao.php index 61eefcc97..e3daf7407 100644 --- a/crmeb/app/dao/product/product/StoreProductDao.php +++ b/crmeb/app/dao/product/product/StoreProductDao.php @@ -122,7 +122,7 @@ class StoreProductDao extends BaseDao })->when(isset($where['cid']) && $where['cid'], function ($query) use ($where) { $query->whereIn('id', function ($query) use ($where) { $query->name('store_product_cate')->whereIn('cate_id', function ($query) use ($where) { - $query->name('store_category')->where('pid', $where['cid'])->field('id')->select(); + $query->name('store_category')->where('pid', $where['cid'])->whereOr('id', $where['cid'])->field('id')->select(); })->field('product_id')->select(); }); })->when(isset($where['coupon_category_id']) && $where['coupon_category_id'] != '', function ($query) use ($where) { diff --git a/crmeb/app/services/product/product/StoreCategoryServices.php b/crmeb/app/services/product/product/StoreCategoryServices.php index c096dca60..77dbe2757 100644 --- a/crmeb/app/services/product/product/StoreCategoryServices.php +++ b/crmeb/app/services/product/product/StoreCategoryServices.php @@ -97,11 +97,11 @@ class StoreCategoryServices extends BaseServices if ($show !== '') $where['is_show'] = $show; if (!$type) $where['pid'] = 0; $data = get_tree_children($this->dao->getTierList($where, ['id', 'id as value', 'cate_name as label', 'cate_name as title', 'pid']), 'children', 'id'); - foreach ($data as &$item) { - if (!isset($item['children'])) { - $item['disabled'] = true; - } - } +// foreach ($data as &$item) { +// if (!isset($item['children'])) { +// $item['disabled'] = true; +// } +// } return $data; } diff --git a/crmeb/app/services/product/product/StoreProductServices.php b/crmeb/app/services/product/product/StoreProductServices.php index 26c3d2f86..7437859fa 100644 --- a/crmeb/app/services/product/product/StoreProductServices.php +++ b/crmeb/app/services/product/product/StoreProductServices.php @@ -620,7 +620,7 @@ class StoreProductServices extends BaseServices $cateGory = $storeCategoryServices->getColumn([['id', 'IN', $cate_id]], 'id,pid', 'id'); foreach ($cate_id as $cid) { if ($cid && isset($cateGory[$cid]['pid'])) { - $cateData[] = ['product_id' => $id, 'cate_id' => $cid, 'cate_pid' => $cateGory[$cid]['pid'], 'status' => $data['is_show'], 'add_time' => $time]; + $cateData[] = ['product_id' => $id, 'cate_id' => $cid, 'cate_pid' => $cateGory[$cid]['pid'] ?: $cid, 'status' => $data['is_show'], 'add_time' => $time]; } } $storeProductCateServices->change($id, $cateData);