当前位置: 首页>>代码示例>>PHP>>正文


PHP Query::andwhere方法代码示例

本文整理汇总了PHP中yii\db\Query::andwhere方法的典型用法代码示例。如果您正苦于以下问题:PHP Query::andwhere方法的具体用法?PHP Query::andwhere怎么用?PHP Query::andwhere使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在yii\db\Query的用法示例。


在下文中一共展示了Query::andwhere方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getWhere

 private function getWhere($filters = [], $select = '*')
 {
     $query = new Query();
     $query->select($select)->from(static::tableName());
     if (isset($filters['D04_DEN_NO']) && $filters['D04_DEN_NO']) {
         $query->andwhere('D04_DEN_NO=:den_no', [':den_no' => $filters['D04_DEN_NO']]);
     }
     if (isset($filters['D04_SAGYO_NO']) && $filters['D04_SAGYO_NO']) {
         $query->andwhere('D04_SAGYO_NO=:sagyo_no', [':sagyo_no' => $filters['D04_SAGYO_NO']]);
     }
     if (isset($filters['offset']) && $filters['offset']) {
         $query->offset($filters['offset']);
     }
     if (isset($filters['limit']) && $filters['limit']) {
         $query->limit($filters['limit']);
     }
     return $query;
 }
开发者ID:huylv-hust,项目名称:ws,代码行数:18,代码来源:Sdptd04denpyosagyo.php

示例2: getWhere

 private function getWhere($filters = [], $select = '*')
 {
     $query = new Query();
     $query->select($select)->from(static::tableName());
     //$query->where('status=:status', [':status' => $status]);
     if (isset($filters['D01_KAIIN_CD']) && $filters['D01_KAIIN_CD']) {
         $query->andwhere('D01_KAIIN_CD = ' . $filters['D01_KAIIN_CD']);
     }
     if (isset($filters['D01_CUST_NO']) && $filters['D01_CUST_NO']) {
         $query->andwhere('D01_CUST_NO = ' . $filters['D01_CUST_NO']);
     }
     if (isset($filters['D01_KAKE_CARD_NO']) && $filters['D01_KAKE_CARD_NO']) {
         $query->where(['D01_KAKE_CARD_NO' => $filters['D01_KAKE_CARD_NO']]);
     }
     if (isset($filters['offset']) && $filters['offset']) {
         $query->offset($filters['offset']);
     }
     if (isset($filters['limit']) && $filters['limit']) {
         $query->limit($filters['limit']);
     }
     return $query;
 }
开发者ID:huylv-hust,项目名称:ws,代码行数:22,代码来源:Sdptd01customer.php

示例3: getWhere

 private function getWhere($filters = [], $select = '*')
 {
     $query = new Query();
     $query->select($select)->from(static::tableName());
     if (count($filters)) {
         foreach ($filters as $field => $val) {
             if ($field != 'offset' && $field != 'limit') {
                 $query->andwhere($field . ' = ' . $val);
             }
         }
     }
     //$query->where('status=:status', [':status' => $status]);
     if (isset($filters['offset']) && $filters['offset']) {
         $query->offset($filters['offset']);
     }
     if (isset($filters['limit']) && $filters['limit']) {
         $query->limit($filters['limit']);
     }
     return $query;
 }
开发者ID:huylv-hust,项目名称:ws,代码行数:20,代码来源:Sdptm03largecom.php

示例4: getUr_l_in_region

 /**
  * Пулечение всех юо.лиц в регионе плательщиков взносов
  * @param null $regional_id
  * @param $region_id
  * @return array
  */
 public static function getUr_l_in_region($regional_id, $region_id)
 {
     $regional_id = (int) $regional_id;
     $region_id = (int) $region_id;
     $db = new Query();
     $db->from(Ur::tableName());
     $db->select(['ur_l.name', 'ur_l.id']);
     $db->innerJoin('region_ur_l', "region_ur_l.id_ur = ur_l.id");
     $db->Where(['=', 'region_ur_l.id_reg', $region_id]);
     $db->andWhere(['=', 'ur_l.plat', '1']);
     $db->andwhere(['=', 'ur_l.regional_id', $regional_id]);
     $db->orderBy('ur_l.name ASC');
     $return = $db->all();
     return $return;
 }
开发者ID:pumi11,项目名称:aau,代码行数:21,代码来源:Vznos.php

示例5: getWhereSearch

 private function getWhereSearch($filters)
 {
     $query = new Query();
     $query->select(["SDP_TD03_DENPYO.*, TO_CHAR(D03_UPD_DATE, 'YYYY/mm/DD') as CHAR_D03_UPD_DATE,\n            SDP_TD01_CUSTOMER.D01_CUST_NAMEN, SDP_TD01_CUSTOMER.D01_CUST_NAMEK, SDP_TD01_CUSTOMER.D01_NOTE"])->from(static::tableName())->leftJoin('SDP_TD01_CUSTOMER', 'SDP_TD03_DENPYO.D03_CUST_NO = SDP_TD01_CUSTOMER.D01_CUST_NO')->orderBy('D03_DEN_NO');
     if (isset($filters['status']) && $filters['status'] != '') {
         if ($filters['status'] == 1) {
             $query->andwhere('SDP_TD03_DENPYO.D03_STATUS=:status', [':status' => 0]);
             $query->andWhere(['>', 'SDP_TD03_DENPYO.D03_SEKOU_YMD', date('Ymd')]);
         }
         if ($filters['status'] == 2) {
             $query->andwhere('SDP_TD03_DENPYO.D03_STATUS=:status', [':status' => 1]);
         }
         if ($filters['status'] == 0) {
             $query->andwhere('SDP_TD03_DENPYO.D03_STATUS=:status', [':status' => 0]);
             $query->andWhere(['<=', 'SDP_TD03_DENPYO.D03_SEKOU_YMD', date('Ymd')]);
         }
     }
     if (isset($filters['car']) && $filters['car']) {
         $query->andwhere(['like', 'SDP_TD03_DENPYO.D03_CAR_NO', $filters['car']]);
     }
     if (isset($filters['job']) && $filters['job'] != '') {
         $denpyo_sagyo = new Sdptd04denpyosagyo();
         $data = $denpyo_sagyo->getData(['D04_SAGYO_NO' => $filters['job']]);
         $arr_den_no = [-1];
         foreach ($data as $k => $v) {
             $arr_den_no[] = $v['D04_DEN_NO'];
         }
         $query->andwhere(['in', 'SDP_TD03_DENPYO.D03_DEN_NO', $arr_den_no]);
     }
     if (isset($filters['start_time']) && $filters['start_time']) {
         $query->andwhere(['>=', 'SDP_TD03_DENPYO.D03_SEKOU_YMD', $filters['start_time']]);
     }
     if (isset($filters['end_time']) && $filters['end_time']) {
         $query->andwhere(['<=', 'SDP_TD03_DENPYO.D03_SEKOU_YMD', $filters['end_time']]);
     }
     if (isset($filters['detail_no'])) {
         $query->andwhere('SDP_TD03_DENPYO.D03_DEN_NO=:den_no', [':den_no' => $filters['detail_no']]);
     }
     if (isset($filters['m50_ss_cd'])) {
         $query->andwhere('SDP_TD03_DENPYO.D03_SS_CD =:m50_ss_cd', [':m50_ss_cd' => $filters['m50_ss_cd']]);
     }
     if (isset($filters['offset']) && $filters['offset']) {
         $query->offset($filters['offset']);
     }
     if (isset($filters['limit']) && $filters['limit']) {
         $query->limit($filters['limit']);
     }
     return $query;
 }
开发者ID:huylv-hust,项目名称:ws,代码行数:49,代码来源:Sdptd03denpyo.php

示例6: getWhere

 /**
  * @param array $filters
  * @param string $select
  * @return Query
  */
 private function getWhere($filters = [], $select = '*')
 {
     $query = new Query();
     $query->select($select)->from(static::tableName());
     if (isset($filters['M05_COM_CD_IN']) && $filters['M05_COM_CD_IN'] != '') {
         $query->andwhere(['IN', 'M05_COM_CD', $filters['M05_COM_CD_IN']]);
     }
     if (isset($filters['M05_COM_CD']) && $filters['M05_COM_CD'] != '') {
         $query->andwhere(['like', 'M05_COM_CD', $filters['M05_COM_CD']]);
     }
     if (isset($filters['M05_COM_NAMEN']) && $filters['M05_COM_NAMEN'] != '') {
         $query->andwhere(['like', 'M05_COM_NAMEN', $filters['M05_COM_NAMEN']]);
     }
     if (isset($filters['M05_NST_CD']) && $filters['M05_NST_CD'] != '') {
         $query->andwhere(['like', 'M05_NST_CD', $filters['M05_NST_CD']]);
     }
     if (isset($filters['in']) && count($filters['in'])) {
         $query->andwhere(['IN', 'M05_KIND_DM_NO', $filters['in']]);
     }
     if (isset($filters['not_in']) && count($filters['not_in'])) {
         $query->andwhere('M05_KIND_DM_NO NOT IN (' . implode(',', $filters['not_in']) . ') OR M05_KIND_DM_NO IS NULL');
     }
     if (isset($filters['offset']) && $filters['offset']) {
         $query->offset($filters['offset']);
     }
     if (isset($filters['limit']) && $filters['limit']) {
         $query->limit($filters['limit']);
     }
     return $query;
 }
开发者ID:huylv-hust,项目名称:ws,代码行数:35,代码来源:Sdptm05com.php


注:本文中的yii\db\Query::andwhere方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。