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()); } /**