當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。