Esempio n. 1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getParseDonors()
 {
     return $this->hasOne(ParseDonors::className(), ['id' => 'parse_donors_id']);
 }
Esempio n. 2
0
 public static function getUnsorted()
 {
     $sql = 'SELECT fs.id, fs.name, pd.url ' . ' FROM ' . self::tableName() . ' fs ' . ' LEFT JOIN ' . ParseDonors::tableName() . ' pd ' . ' ON fs.parse_donors_id = pd.id ' . ' WHERE fs.feature_id IS NULL ' . ' ORDER BY fs.name ';
     return self::findBySql($sql)->asArray()->all();
 }
 public static function getUnsorted()
 {
     $sql = 'SELECT fms.id, fms.metric_synonim, pd.url ' . ' FROM ' . self::tableName() . ' fms ' . ' LEFT JOIN ' . ParseDonors::tableName() . ' pd ' . ' ON fms.parse_donor_id = pd.id ' . ' WHERE fms.feature_metric_id IS NULL ' . ' ORDER BY fms.metric_synonim ';
     return self::findBySql($sql)->asArray()->all();
 }
Esempio n. 4
0
 public static function getExistingDonorAccount($user_id, $donor_abbr)
 {
     $sql = 'SELECT uda.id, uda.login, uda.password,' . ' uda.user_id, uda.parse_donors_id, uda.reputation ' . ' FROM ' . self::tableName() . ' uda ' . ' JOIN ' . ParseDonors::tableName() . ' pd ' . ' ON uda.parse_donors_id = pd.id ' . ' WHERE uda.user_id = :user_id' . ' AND pd.abbr = :abbr';
     $result = self::findBySql($sql, [':abbr' => $donor_abbr, ':user_id' => $user_id])->asArray()->one();
     return $result;
 }
Esempio n. 5
0
 public static function findFreeDonorEmail($donor_abbr)
 {
     $sql = 'SELECT ufm.id, ufm.email, ufm.password ' . ' FROM ' . self::tableName() . ' ufm ' . ' JOIN ' . UsersFakeMailsByDonors::tableName() . ' ufmbd ' . ' ON ufm.id = ufmbd.users_fake_mail_id ' . ' JOIN ' . ParseDonors::tableName() . ' pd ' . ' ON ufmbd.parse_donors_id = pd.id ' . ' WHERE pd.abbr = :abbr ' . ' AND ufm.user_id IS NULL ';
     $result = self::findBySql($sql, [':abbr' => $donor_abbr])->asArray()->one();
     return $result;
 }
Esempio n. 6
0
 /**
  * Извлечение всех unsorted синонимов с url их сайтов-источников
  * @return array
  */
 public static function getUnsorted()
 {
     $sql = 'SELECT cs.id, cs.name, cs.parent_category, cs.grandparent_category,' . ' pd.url ' . ' FROM ' . self::tableName() . ' cs ' . ' LEFT JOIN ' . ParseDonors::tableName() . ' pd ' . ' ON cs.parse_donors_id = pd.id ' . ' WHERE cs.category_id IS NULL' . ' ORDER BY cs.name';
     return self::findBySql($sql)->asArray()->all();
 }