From abdd201f6b1c961405d31cca5314e95a5b064a9c Mon Sep 17 00:00:00 2001 From: monanxiao Date: Tue, 14 Mar 2023 18:14:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B0=8F=E7=BB=84=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/store/product/StoreCategory.php | 9 ++++++--- crmeb/traits/CategoresRepository.php | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/controller/api/store/product/StoreCategory.php b/app/controller/api/store/product/StoreCategory.php index 931f6e7f..1dbc6cf9 100644 --- a/app/controller/api/store/product/StoreCategory.php +++ b/app/controller/api/store/product/StoreCategory.php @@ -48,16 +48,19 @@ class StoreCategory extends BaseController if (isset($value['children'])) { $level = []; foreach ($value['children'] as $child) { - if (isset($child['children'])) { - $level[] = $child; - } + $level[] = $child; + // if (isset($child['children'])) { + // $level[] = $child; + // } } + if (isset($level) && !empty($level)) { $value['children'] = $level; $ret[] = $value; } } } + $data['list'] = $ret; return app('json')->success($data); } diff --git a/crmeb/traits/CategoresRepository.php b/crmeb/traits/CategoresRepository.php index 06401740..59f36bbc 100644 --- a/crmeb/traits/CategoresRepository.php +++ b/crmeb/traits/CategoresRepository.php @@ -35,7 +35,7 @@ trait CategoresRepository */ public function getApiFormatList($merID,$status = null, $source = 2) { - return formatCategory($this->dao->getAll($merID,$status,$source)->hidden(['path','level','mer_id','create_time'])->toArray(), $this->dao->getPk()); + return formatCategory($this->dao->getAll($merID,$status, $source)->hidden(['path','level','mer_id','create_time'])->toArray(), $this->dao->getPk()); } /**