mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
Update GoodsService.php
This commit is contained in:
parent
90c8458204
commit
7585090613
@ -34,7 +34,8 @@ class GoodsService extends Service
|
||||
*/
|
||||
public function getCateData($simple = true): array
|
||||
{
|
||||
$cates = $this->app->db->name('ShopGoodsCate')->where(['status' => 1])->column('id,pid,name', 'id');
|
||||
$map = ['status' => 1, 'deleted' => 0];
|
||||
$cates = $this->app->db->name('ShopGoodsCate')->where($map)->column('id,pid,name', 'id');
|
||||
foreach ($cates as $cate) if (isset($cates[$cate['pid']])) $cates[$cate['id']]['parent'] =& $cates[$cate['pid']];
|
||||
foreach ($cates as $key => $cate) {
|
||||
$id = $cate['id'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user