peijunlei 2 weeks ago
parent
commit
ef6f279446
  1. 2
      app/model/Model.php
  2. 5
      app/service/ContentService.php

2
app/model/Model.php

@ -101,7 +101,7 @@ class Model extends BaseModel
return dataReturn($this->sucCode,$this->getMsg,$res); 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])); $key = md5($this->className . json_encode([$where,$order,$field,$with]));

5
app/service/ContentService.php

@ -838,7 +838,10 @@ class ContentService {
$content = $content -> where($param['where']); $content = $content -> where($param['where']);
} }
$data = $content ->whereIn('id',$subIds) $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') ->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){ ->paginate($param['limit'])->each(function (&$item)use($param){
if(!empty($item['category'])){ if(!empty($item['category'])){

Loading…
Cancel
Save