diff --git a/app/data/service/GoodsService.php b/app/data/service/GoodsService.php index c95448e89..978e61d88 100644 --- a/app/data/service/GoodsService.php +++ b/app/data/service/GoodsService.php @@ -2,6 +2,7 @@ namespace app\data\service; +use think\admin\extend\DataExtend; use think\admin\Service; /** @@ -12,6 +13,22 @@ use think\admin\Service; class GoodsService extends Service { + /** + * 获取分类数据 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function getCateList(): array + { + $map = ['deleted' => 0, 'status' => 1]; + $query = $this->app->db->name('ShopGoodsCate'); + $query->where($map)->order('sort desc,id desc'); + $query->withoutField('sort,status,deleted,create_at'); + return DataExtend::arr2tree($query->select()->toArray()); + } + /** * 最大分类级别 * @return integer diff --git a/app/data/view/news_item/form.html b/app/data/view/news_item/form.html index a7604fee0..aaa6dc00c 100644 --- a/app/data/view/news_item/form.html +++ b/app/data/view/news_item/form.html @@ -2,9 +2,7 @@ {block name='content'}
- diff --git a/app/data/view/shop_goods_mark/form.html b/app/data/view/shop_goods_mark/form.html index c3232180e..95a944dae 100644 --- a/app/data/view/shop_goods_mark/form.html +++ b/app/data/view/shop_goods_mark/form.html @@ -1,14 +1,11 @@ \ No newline at end of file