Esempio n. 1
0
 /**
  * Lists all PartProviderUser models.
  * @return mixed
  */
 public function actionIndex()
 {
     //        $this->layout = "../views/layouts/admin.php";
     $searchModel = new PartProviderUserSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Esempio n. 2
0
 public function setData($params)
 {
     foreach ($params as $property => $value) {
         if (property_exists($this, $property)) {
             if (is_array($this->{$property})) {
                 $this->{$property} = array_merge($this->{$property}, $value);
             } else {
                 $this->{$property} = $value;
             }
         }
     }
     //        var_dump($this->ePrices);die;
     $this->_wsdl_uri = isset($params['method']) ? $params[$params['method'] . '_wsdl_uri'] : $this->_wsdl_uri;
     $puser = new PartProviderUserSearch();
     $p = $puser->getUserProvider(['store_id' => $params['store_id'], 'provider_id' => $this->id]);
     if ($p->count > 0) {
         $this->login = $p->models[0]->attributes['login'];
         $this->store_id = $p->models[0]->attributes['store_id'];
         $this->password = $p->models[0]->attributes['password'];
         $this->marga = $p->models[0]->attributes['marga'] / 100 + 1;
         $this->srokdays = $p->models[0]->srok;
         $this->find = true;
     } else {
         $this->find = false;
     }
 }
Esempio n. 3
0
File: Run.php Progetto: kd-brinex/kd
 private function getAccess($provider, $options)
 {
     if (empty($provider_id = $this->getProviderId($provider))) {
         return false;
     }
     if (!empty($store = $this->getStoreId($options, $provider_id))) {
         $accessData = PartProviderUserSearch::find()->select('login, password, marga, store_id')->asArray()->where('store_id = :store_id AND provider_id = :provider_id', [':store_id' => $store, ':provider_id' => $provider_id])->one();
     }
     //        var_dump($accessData);die;
     return isset($accessData) ? $accessData : false;
 }