質問編集履歴
2
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -32,24 +32,10 @@
|
|
32
32
|
|
33
33
|
```
|
34
34
|
|
35
|
-
これを綺麗にまとめ
|
35
|
+
これを綺麗にまとめたく思い
|
36
36
|
|
37
|
-
|
37
|
+
find()を一度にだけにしたく
|
38
38
|
|
39
|
-
|
39
|
+
条件を$conditionsで条件分岐しようと思うのですが一度使用してしまっています。
|
40
40
|
|
41
|
-
if(empty($ips)){
|
42
|
-
|
43
|
-
$conditions=array('conditions' => array('Runhists.username' => $conditions,'Runhists.private_flg' => 0),'order' => 'created desc', 'limit'=>100);
|
44
|
-
|
45
|
-
} else {
|
46
|
-
|
47
|
-
$conditions=array('conditions' => $conditions, 'order' => 'created desc','limit'=>100);
|
48
|
-
|
49
|
-
}
|
50
|
-
|
51
|
-
$querys=$this->Runhists->find('all',$conditions);
|
52
|
-
|
53
|
-
```
|
54
|
-
|
55
|
-
|
41
|
+
どうしたらうまく綺麗にまとめられますでしょうか?
|
1
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,10 +1,28 @@
|
|
1
1
|
```ここに言語を入力
|
2
|
+
|
3
|
+
if ( $u_out == "history" ){
|
4
|
+
|
5
|
+
$conditions=array();
|
6
|
+
|
7
|
+
if ( $u_userid != "" ){
|
8
|
+
|
9
|
+
$conditions=array('username' => $u_userid);
|
10
|
+
|
11
|
+
}
|
2
12
|
|
3
13
|
$ips=CommonComponent::GetAllowIPsByAccessIp();
|
4
14
|
|
5
15
|
if(empty($ips)){
|
6
16
|
|
17
|
+
$querys = $this->Runhists->find('all', array(
|
18
|
+
|
19
|
+
'conditions' => array(
|
20
|
+
|
21
|
+
'Runhists.username' => $conditions,
|
22
|
+
|
23
|
+
'Runhists.private_flg' => 0),
|
24
|
+
|
7
|
-
|
25
|
+
'order' => 'created desc', 'limit'=>100));
|
8
26
|
|
9
27
|
} else {
|
10
28
|
|