Browse Source

fix(content): 修复内容分类排序问题

- 修改分类查询排序字段从 id asc 为 sort asc,id asc
- 确保分类按照自定义排序字段进行排列
- 保持相同排序值时按 id 升序排列的逻辑
master
zhangf@suq.cn 2 weeks ago
parent
commit
0a1dca9c31
  1. 2
      app/service/ContentService.php

2
app/service/ContentService.php

@ -802,7 +802,7 @@ class ContentService {
public function indexContent($param): \think\response\Json public function indexContent($param): \think\response\Json
{ {
$Cate = new Category(); $Cate = new Category();
$cate = $Cate->getAllCustomArrayData(['seller_id'=>$param['seller_id'],'website_id'=>$param['website_id'],'lang'=>$param['lang']],'id asc','id,title,parent_id')['data'];
$cate = $Cate->getAllCustomArrayData(['seller_id'=>$param['seller_id'],'website_id'=>$param['website_id'],'lang'=>$param['lang']],'sort asc,id asc','id,title,parent_id')['data'];
if(empty($cate)){ if(empty($cate)){
return json(['code' => 0, 'msg' => 'ok', 'count' => 0, 'data' => []]); return json(['code' => 0, 'msg' => 'ok', 'count' => 0, 'data' => []]);
} }

Loading…
Cancel
Save