private function searchConditions() { $conditions = []; if (!$this->isNationWideBid()) { $bid = $this->getOperatorBid(); $conditions[] = '{User}.bid=' . $bid; } $post = $this->request->get(); if (isset($post['keyword']) and !empty($post['keyword'])) { $keyword = $post['keyword']; if (preg_match('/^\\d+$/', $keyword)) { $conditions[] = '{User}.uid = ' . intval($keyword); } if (\Util\Validator::isCh($keyword)) { $conditions[] = '{User}.realname = \'' . $keyword . '\''; } } $conditions[] = '{Loan}.status=' . \App\LoanStatus::getStatusRepay(); return $conditions; }
private function searchConditions() { $conditions = []; if (!$this->isNationWideBid()) { $bid = $this->getOperatorBid(); $conditions[] = '{User}.bid=' . $bid; } $post = $this->request->get(); if (isset($post['keyword']) and !empty($post['keyword'])) { $keyword = $post['keyword']; if (preg_match('/^\\d+$/', $keyword)) { $conditions[] = '{User}.uid = ' . intval($keyword); } if (\Util\Validator::isCh($keyword)) { $conditions[] = '{User}.realname = \'' . $keyword . '\''; } } $conditions[] = '{Loan}.status=' . \App\LoanStatus::getStatusRepay(); if (isset($post['deal']) and in_array($post['deal'], [1, -1])) { $conditions[] = '{Loan}.remit_certify' . ($post['deal'] == 1 ? '!=\'\'' : '=\'0\''); } $conditions[] = '{Loan}.contract=1 and {Loan}.gps=1'; return $conditions; }