From b9fb73a748f6ecae7b36b27a6c0a47c24572a5dc Mon Sep 17 00:00:00 2001 From: heshupeng <hsp@bronet.cn> Date: Mon, 14 Dec 2020 12:30:32 +0800 Subject: [PATCH] 排序优化 --- application/api/controller/Index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/controller/Index.php b/application/api/controller/Index.php index 352d072..e5c93c6 100644 --- a/application/api/controller/Index.php +++ b/application/api/controller/Index.php @@ -223,7 +223,7 @@ class Index extends Api } $data = Job::where($where) ->field("*,{$distance} distance") - ->order(['is_top'=>'desc','top_time'=>'desc','distance'=>'asc','weigh'=>'asc']) + ->order(['distance'=>'asc','weigh'=>'desc']) ->paginate($page_num,false,['page'=>$page]) ->each(function($v){ $v->visible(['id','cover','job_name','salary','people_num','factory_price_total','factory_price','subsidy_price']); @@ -308,7 +308,7 @@ class Index extends Api ->join('job_collect jc','jc.job_id = j.id and user_id = '.$this->auth->id) ->where($where) ->field('j.*') - ->order(['j.is_top'=>'desc','j.top_time'=>'desc','jc.createtime'=>'desc','weigh'=>'asc']) + ->order(['jc.createtime'=>'desc','j.weigh'=>'desc']) ->paginate($page_num,false,['page'=>$page]) ->each(function($v){ $v->visible(['id','cover','job_name','salary','people_num','factory_price_total','factory_price','subsidy_price']); -- libgit2 0.24.0