1.提交缺失的东西

This commit is contained in:
2025-05-20 17:51:59 +08:00
parent 8c6701e8e0
commit 22461277ee
2 changed files with 17 additions and 1 deletions

View File

@ -59,6 +59,14 @@ class GoodsCategoryController extends BaseAdminController
return $this->fail(GoodsCategoryLogic::getError());
}
// 查询分类
public function checkCategory(){
$result = GoodsCategoryLogic::getAllTree();
if (true === $result) {
return $this->success('查询成功', $result);
}
return $this->fail(GoodsCategoryLogic::getError());
}
/**
* @notes 编辑

View File

@ -60,7 +60,15 @@ class GoodsCategoryLogic extends BaseLogic
return false;
}
}
public static function getAllTree()
{
$lists = Db::name('goods_category')
->field(['name', 'id', 'pid', 'level'])
->where(['del' => 0])
->order(['sort' => 'desc'])
->select()->toArray();
return $lists;
}
/**
* @notes 编辑