diff --git a/app/model/Model.php b/app/model/Model.php index 6f9f60d..aec17d5 100644 --- a/app/model/Model.php +++ b/app/model/Model.php @@ -101,7 +101,7 @@ class Model extends BaseModel return dataReturn($this->sucCode,$this->getMsg,$res); } - public function getAllCustomArrayData($where,$order='id desc',$field="*",$with=[],$offset=0): array + public function getAllCustomArrayData($where,$order='sort asc,id desc',$field="*",$with=[],$offset=0): array { $key = md5($this->className . json_encode([$where,$order,$field,$with])); diff --git a/app/service/ContentService.php b/app/service/ContentService.php index 65e47fc..3aa8fd9 100644 --- a/app/service/ContentService.php +++ b/app/service/ContentService.php @@ -838,7 +838,10 @@ class ContentService { $content = $content -> where($param['where']); } $data = $content ->whereIn('id',$subIds) - ->order('id','desc') + ->order([ + 'sort'=>'asc', + 'id'=>'desc' + ]) ->field('id,seller_id,category_id,sub_category_ids,module_id,lang,main_id,title,sub_title,thumbnail,hits,admin_id,status,check_status,url as link_url,publish_time,sort,version,show_version,is_del,del_user_id') ->paginate($param['limit'])->each(function (&$item)use($param){ if(!empty($item['category'])){