回答編集履歴

1

CakePHPのコードを追記

2017/08/24 15:46

投稿

aro10
aro10

スコア4106

test CHANGED
@@ -1,3 +1,29 @@
1
1
  複数カラムに対して指定のキーワードを除外した行の検索であれば、それぞれのカラムに対しての条件をANDで繋げればよいのではないでしょうか
2
2
 
3
3
  clumn01 not in ('固定給') AND clumn02 not in ('固定給') AND clumn03
4
+
5
+
6
+
7
+ CakePHP3のマニュアルを見る限りでは多分こんな感じでしょうか
8
+
9
+ [CakePHP3 クエリービルダー](https://book.cakephp.org/3.0/ja/orm/query-builder.html)
10
+
11
+ ```
12
+
13
+ $query = $cities->find()
14
+
15
+ ->where(function ($exp, $q) {
16
+
17
+ return $exp->notIn('clumn01', ['固定給']);
18
+
19
+ })->andWhere(function ($exp, $q) {
20
+
21
+ return $exp->notIn('clumn02', ['固定給']);
22
+
23
+ })->andWhere(function ($exp, $q) {
24
+
25
+ return $exp->notIn('clumn03', ['固定給']);
26
+
27
+ });
28
+
29
+ ```