Browse Source

子查询

linwu 3 months ago
parent
commit
04da3afd4b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/Http/Controllers/Mobile/Ic/IndexController.php

+ 1 - 1
app/Http/Controllers/Mobile/Ic/IndexController.php

@@ -33,7 +33,7 @@ class IndexController extends MobileBaseController
 
         //招聘列表
         $size = 10;
-        $list = Jobs::whereRaw('id in (select id from jobs where is_ic = 1 and valid = 1 and audit = 1 and display = 1 ORDER BY updated_at desc)')->groupBy('company_id')->limit(5)->get();
+        $list = Jobs::whereRaw('id in (select max(id) from jobs where is_ic = 1 and valid = 1 and audit = 1 and display = 1 GROUP BY company_id)')->limit(5)->get();
         if ($list->isEmpty()) {
             $recruit_list = [];
         } else {