if ( $u_out == "history" ){ $conditions=array(); if ( $u_userid != "" ){ $conditions=array('username' => $u_userid); } $ips=CommonComponent::GetAllowIPsByAccessIp(); if(empty($ips)){ $querys = $this->Runhists->find('all', array( 'conditions' => array( 'Runhists.username' => $conditions, 'Runhists.private_flg' => 0), 'order' => 'created desc', 'limit'=>100)); } else { $querys=$this->Runhists->find('all', array( 'conditions' => $conditions, 'order' => 'created desc','limit'=>100)); }
これを綺麗にまとめたく思い
find()を一度にだけにしたく
条件を$conditionsで条件分岐しようと思うのですが一度使用してしまっています。
どうしたらうまく綺麗にまとめられますでしょうか?
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。