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);