Esempio n. 1
0
 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 . '\'';
         }
     }
     if (isset($post['deal']) and in_array($post['deal'], [-1, 1])) {
         if ($post['deal'] == 1) {
             $conditions[] = '{Loan}.status>=' . \App\LoanStatus::getStatusRunConfirm();
         } else {
             $conditions[] = '{Loan}.status=' . \App\LoanStatus::getStatusRcAgree();
             $conditions[] = '{Loan}.gps=1 and {Loan}.contract=1 and {Loan}.car_key=1 and {Loan}.pledge_notary=1';
         }
     } else {
         $conditions[] = '{Loan}.status>=' . \App\LoanStatus::getStatusRcAgree();
         $conditions[] = '{Loan}.gps=1 and {Loan}.contract=1 and {Loan}.car_key=1 and {Loan}.pledge_notary=1';
     }
     return $conditions;
 }
Esempio n. 2
0
 private function searchConditions()
 {
     $conditions = [];
     $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;
         }
     }
     if (isset($post['bid']) and !empty($post['bid'])) {
         $conditions[] = '{User}.bid=' . intval($post['bid']);
     }
     return $conditions;
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
 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;
 }
Esempio n. 5
0
 /**
  * 贷款列表查看
  */
 public function listAction()
 {
     $conditions = [];
     //关键字搜索
     $post = $this->request->get();
     if (isset($post['keyword']) and !empty($post['keyword'])) {
         $keyword = $post['keyword'];
         if (preg_match('/^\\d+$/', $keyword)) {
             $conditions['uid'] = intval($keyword);
         }
         if (\Util\Validator::isCh($keyword)) {
             $conditions['realname'] = $keyword;
         }
     }
     //客户经理
     if ($this->authHasAction('apply')) {
         $conditions['oid'] = $this->getOperatorId();
     } else {
         if ($this->authHasAction('face') || $this->authHasAction('visit') || $this->authHasAction('car') || $this->authHasAction('list')) {
             $conditions['bid'] = $this->getOperatorBid();
         }
     }
     //分页
     $p = $this->urlParam();
     $limit = $this->limit($p);
     $User = new User();
     $list = $User->sketches($conditions, $limit[0], $limit[1]);
     $count = $User->getSketchCount($conditions);
     $page = $this->page($count, $limit[0], $p);
     if (!$this->isAjax()) {
         $operates = $this->operators();
         $this->view->setVars(['operates' => $operates]);
     }
     $this->view->setVars(['list' => $list, 'page' => $page]);
 }