Avoid to get a random result.
This commit is contained in:
parent
aaad3c3b75
commit
2f89d526eb
@ -90,11 +90,13 @@ class Stripe extends CommonObject
|
|||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT tokenstring";
|
$sql = "SELECT tokenstring";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."oauth_token WHERE";
|
$sql .= " FROM ".MAIN_DB_PREFIX."oauth_token";
|
||||||
|
$sql .= " WHERE service = '".$this->db->escape($mode)."'";
|
||||||
if (empty($fk_soc)) $sql .= " entity = ".$conf->entity. " AND";
|
if (empty($fk_soc)) $sql .= " entity = ".$conf->entity. " AND";
|
||||||
$sql .= " service = '".$mode."'";
|
|
||||||
if ($fk_soc > 0) {
|
if ($fk_soc > 0) {
|
||||||
$sql .= " AND fk_soc = ".$fk_soc;
|
$sql .= " AND fk_soc = ".$fk_soc;
|
||||||
|
} else {
|
||||||
|
$sql .= " AND fk_soc IS NULL";
|
||||||
}
|
}
|
||||||
$sql .= " AND fk_user IS NULL AND fk_adherent IS NULL";
|
$sql .= " AND fk_user IS NULL AND fk_adherent IS NULL";
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user