正在显示
1 个修改的文件
包含
2 行增加
和
18 行删除
| @@ -897,15 +897,7 @@ class BTemplateLogic extends BaseLogic | @@ -897,15 +897,7 @@ class BTemplateLogic extends BaseLogic | ||
| 897 | * @time :2023/12/20 10:26 | 897 | * @time :2023/12/20 10:26 |
| 898 | */ | 898 | */ |
| 899 | public function getCategoryList($categoryModel,$status = 0,$filed = ['*']){ | 899 | public function getCategoryList($categoryModel,$status = 0,$filed = ['*']){ |
| 900 | - $data = array(); | ||
| 901 | - $list = $categoryModel->list(['pid'=>0,'status'=>$status],['sort','id'],$filed); | ||
| 902 | - foreach ($list as $v){ | ||
| 903 | - $data[] = $v; | ||
| 904 | - $son_list = $categoryModel->list(['pid'=>$v['id'],'status'=>$status],['sort','id'],$filed); | ||
| 905 | - foreach ($son_list as $v1){ | ||
| 906 | - $data[] = $v1; | ||
| 907 | - } | ||
| 908 | - } | 900 | + $data = $categoryModel->list(['status'=>$status],['sort','id'],$filed); |
| 909 | return $this->success($data); | 901 | return $this->success($data); |
| 910 | } | 902 | } |
| 911 | 903 | ||
| @@ -917,15 +909,7 @@ class BTemplateLogic extends BaseLogic | @@ -917,15 +909,7 @@ class BTemplateLogic extends BaseLogic | ||
| 917 | * @time :2023/12/20 10:26 | 909 | * @time :2023/12/20 10:26 |
| 918 | */ | 910 | */ |
| 919 | public function getCategoryModuleList($categoryModel,$module_id,$status = 0,$filed = ['*']){ | 911 | public function getCategoryModuleList($categoryModel,$module_id,$status = 0,$filed = ['*']){ |
| 920 | - $data = array(); | ||
| 921 | - $list = $categoryModel->list(['pid'=>0, 'module_id'=>$module_id , 'status'=>$status],['sort','id'],$filed); | ||
| 922 | - foreach ($list as $v){ | ||
| 923 | - $data[] = $v; | ||
| 924 | - $son_list = $categoryModel->list(['pid'=>$v['id'],'module_id'=>$module_id,'status'=>$status],['sort','id'],$filed); | ||
| 925 | - foreach ($son_list as $v1){ | ||
| 926 | - $data[] = $v1; | ||
| 927 | - } | ||
| 928 | - } | 912 | + $data = $categoryModel->list(['module_id'=>$module_id , 'status'=>$status],['sort','id'],$filed); |
| 929 | return $this->success($data); | 913 | return $this->success($data); |
| 930 | } | 914 | } |
| 931 | 915 |
-
请 注册 或 登录 后发表评论