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


PHP Region::tableName方法代码示例

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


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

示例1: search

 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = User::find()->joinWith('profile.region');
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $dataProvider->sort->attributes['region'] = ['asc' => [Region::tableName() . '.name' => SORT_ASC], 'desc' => [Region::tableName() . '.name' => SORT_DESC]];
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['status' => $this->status, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, Region::tableName() . '.id' => $this->region]);
     $query->andFilterWhere(['like', 'username', $this->username])->andFilterWhere(['like', 'auth_key', $this->auth_key])->andFilterWhere(['like', 'password_hash', $this->password_hash])->andFilterWhere(['like', 'password_reset_token', $this->password_reset_token])->andFilterWhere(['like', 'email', $this->email]);
     return $dataProvider;
 }
开发者ID:filimonchuk93,项目名称:monitoring.my,代码行数:22,代码来源:UserSearch.php

示例2: excel

 public function excel($params)
 {
     $query = Mon1str::find()->joinWith('monitoring1.user.profile.region');
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => array('pageSize' => 10000)]);
     $dataProvider->sort->attributes['region'] = ['asc' => [Region::tableName() . '.name' => SORT_ASC], 'desc' => [Region::tableName() . '.name' => SORT_DESC]];
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     //
     $query->andFilterWhere([Monitoring1::tableName() . '.date' => $this->date, Region::tableName() . '.id' => $this->region]);
     return $dataProvider;
 }
开发者ID:filimonchuk93,项目名称:monitoring.my,代码行数:15,代码来源:Mon1strSearch.php

示例3: search

 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     if (Yii::$app->user->can('admin')) {
         $query = WeekMon1::find()->joinWith('user.profile.region');
     } else {
         $query = WeekMon1::find()->joinWith('user.profile.region')->where([Monitoring1::tableName() . '.user_id' => Yii::$app->user->id]);
     }
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $dataProvider->sort->attributes['region'] = ['asc' => [Region::tableName() . '.name' => SORT_ASC], 'desc' => [Region::tableName() . '.name' => SORT_DESC]];
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     //
     $query->andFilterWhere(['user_id' => $this->user_id, WeekMon1::tableName() . '.startDate' => $this->startDate, Region::tableName() . '.id' => $this->region, WeekMon1::tableName() . '.status' => $this->status]);
     //        $query->andFilterWhere(['like', 'date', $this->date]);
     return $dataProvider;
 }
开发者ID:filimonchuk93,项目名称:monitoring.my,代码行数:27,代码来源:WeekMon1Search.php

示例4: searchAll

 public function searchAll($params)
 {
     if (Yii::$app->user->can('admin')) {
         $query = Monitoring2::find()->joinWith('user.profile.region');
     } else {
         $query = Monitoring2::find()->joinWith('user.profile.region')->where([Monitoring2::tableName() . '.user_id' => Yii::$app->user->id]);
     }
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $query->all();
     }
     $query->andFilterWhere(['user_id' => $this->user_id, 'month_id' => $this->month_id, 'year_id' => $this->year_id, 'date' => $this->date, Region::tableName() . '.id' => $this->region, Monitoring2::tableName() . '.status' => $this->status]);
     return $query->all();
 }
开发者ID:filimonchuk93,项目名称:monitoring.my,代码行数:16,代码来源:Monitoring2Search.php

示例5: getAccessableOfficesWhereUserIs

 public function getAccessableOfficesWhereUserIs($role)
 {
     switch ($role) {
         case self::MANAGER:
             return $this->offices;
             break;
         case self::COMDIR:
             /* Коммерческий директор имеет доступ к офисам своего региона */
             $offices = [];
             $regions = Region::find(['user_id' => 'id'])->innerJoin('questionlist_users_to_regions utr', 'utr.region_id=' . Region::tableName() . '.id', ['utr.user_id' => $this->id])->with('offices')->all();
             if (!$regions) {
                 return;
             }
             foreach ($regions as $region) {
                 $offices = array_merge($offices, $region->offices);
             }
             return $offices;
             break;
         case self::ADMIN:
             /* Админ имеет доступ к всем офисам */
             if (!$this->isAdmin) {
                 return;
             }
             return Office::find()->all();
             break;
     }
 }
开发者ID:igribov,项目名称:question-list,代码行数:27,代码来源:User.php


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