我正在嘗試將條件添加為active is not qual to 1,但我無法弄清楚它是如何在我的查詢中正常工作的。這是我的查詢$career_solutions_data = DB::select("SELECTcareer_solutions.id,role_users.role_id,career_solutions.user_id,career_solutions.subject,career_solutions.date,career_solutions.public,career_solutions.views,career_solutions.optional,career_solutions.on_offer,career_solutions.active,users.username,users.profile_picture,categories.category,categories.category_url,categories.color,career_solutions_categories.category as sub_category,career_solutions_format.category as event_format,career_solutions_certification.category as certificationFROM career_solutionsINNER JOIN categoriesON categories.id = career_solutions.topic_category_idINNER JOIN career_solutions_formatON career_solutions_format.id = career_solutions.topic_format_idINNER JOIN career_solutions_certificationON career_solutions_certification.id = career_solutions.topic_certification_idINNER JOIN career_solutions_categoriesON career_solutions_categories.id = career_solutions.topic_subcategory_idINNER JOIN usersON users.id = career_solutions.user_idLEFT JOIN role_users on role_users.role_id = users.idINNER JOIN privacy_settingsON privacy_settings.user_id = users.idWHERE users.deleted_at IS NULLAND ((privacy_settings.career_solutions = 0 AND public = 1 )OR (users.id IN (SELECT contacts.contact_idFROM contactsWHERE contacts.user_id = $id)))OR users.id = $idORDER BY date desc limit 5000");$role = User::with('role')->where ('id', '=', $id)->first(); } }這是我試圖添加的內容:WHERE `career_solutions.active` <> `1`orWHERE `active` <> `1`orWHERE `active` != `1`但沒有工作。所以,我不需要用 . 顯示帖子active = 1。我還有另外 3 個查詢,不同的是,我用過這個 : ->where("active","!=",1);,但在這里我不能使用它。
- 1 回答
- 0 關注
- 148 瀏覽
添加回答
舉報
0/150
提交
取消