瀏覽代碼

子查询

linwu 3 月之前
父節點
當前提交
1ea74fdd6b
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      app/Http/Controllers/Mobile/Ic/IndexController.php

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

@@ -33,7 +33,10 @@ class IndexController extends MobileBaseController
 
         //招聘列表
         $size = 10;
-        $list = Jobs::whereIn('id', DB::raw("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();
+
+        $sql = "select id from jobs where is_ic = 1 and valid = 1 and audit = 1 and display = 1 and deleted_at is null ORDER BY updated_at desc";
+        $list = DB::table($sql . 'as job')->groupBy('company_id')->limit(5)->get();
+//        $list = Jobs::whereIn('id', DB::raw("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();
         if ($list->isEmpty()) {
             $recruit_list = [];
         } else {