update from merge develop de webservice
This commit is contained in:
parent
3b6a8ec2f6
commit
0b5d5b4685
@ -117,17 +117,17 @@ class Metier_Liens_Base
|
|||||||
->where('l.idPar = :id')->setParameter('id', $id)
|
->where('l.idPar = :id')->setParameter('id', $id)
|
||||||
->orderBy('l.PDetention', 'DESC');
|
->orderBy('l.PDetention', 'DESC');
|
||||||
|
|
||||||
// Actif / Inactif
|
// Actif / Inactif
|
||||||
if (null !== $actif) {
|
if (null !== $actif) {
|
||||||
if (false === $actif) {
|
if (false === $actif) {
|
||||||
$qb->andWhere('l.actif = 0');
|
$qb->andWhere('l.actif = 0');
|
||||||
} else {
|
} else {
|
||||||
$qb->andWhere('l.actif = 1');
|
$qb->andWhere('l.actif = 1');
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Don't display deleted - anomaly
|
// Don't display deleted - anomaly
|
||||||
$qb->andWhere("l.dateSuppr = '0000-00-00 00:00:00'");
|
$qb->andWhere("l.dateSuppr = '0000-00-00 00:00:00'");
|
||||||
$stmt = $qb->execute();
|
$stmt = $qb->execute();
|
||||||
$liens = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
$liens = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||||
} catch (\Doctrine\DBAL\DBALException $e) {
|
} catch (\Doctrine\DBAL\DBALException $e) {
|
||||||
|
@ -349,7 +349,7 @@ class Metier_Partenaires_MBilans
|
|||||||
* Nombre de bilans maximums retournés
|
* Nombre de bilans maximums retournés
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function listeBilans($accesPartenaire = false, $nbMaxBilans = 0)
|
public function listeBilans($accesPartenaire = false, $nbMaxBilans = 0, $idClient = 0)
|
||||||
{
|
{
|
||||||
$dateDerDepot = 0;
|
$dateDerDepot = 0;
|
||||||
$tabRet = $tabRet2 = $tabRet3 = $tabRet = array();
|
$tabRet = $tabRet2 = $tabRet3 = $tabRet = array();
|
||||||
@ -358,12 +358,21 @@ class Metier_Partenaires_MBilans
|
|||||||
if ($this->companyEvenDateStop !== null) {
|
if ($this->companyEvenDateStop !== null) {
|
||||||
$where.= " AND dateExercice<'".$this->companyEvenDateStop."'";
|
$where.= " AND dateExercice<'".$this->companyEvenDateStop."'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- Si c'est un client qui consulte, alors il ne peut voir que ses bilans confidentiels ou tous les bilans publiques.
|
||||||
|
// --- 0 : consultation de l'application (calcul du score ...)
|
||||||
|
// --- 1 : consultation d'un membre de scores et décisions
|
||||||
|
// --- 147 : consultation d'un opérateur de l'arménie
|
||||||
|
if ($idClient > 1 && $idClient != 147) {
|
||||||
|
$where.= " AND (confidentiel_client = ".$idClient." OR confidentiel = 0)";
|
||||||
|
}
|
||||||
|
|
||||||
$where.= " ORDER BY dateExercice DESC, CASE typeBilan WHEN 'N' THEN 1 WHEN 'S' THEN 2 ELSE 3 END";
|
$where.= " ORDER BY dateExercice DESC, CASE typeBilan WHEN 'N' THEN 1 WHEN 'S' THEN 2 ELSE 3 END";
|
||||||
if ($nbMaxBilans > 0) {
|
if ($nbMaxBilans > 0) {
|
||||||
$where.= " LIMIT 0, $nbMaxBilans";
|
$where.= " LIMIT 0, $nbMaxBilans";
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = "typeBilan, dateProvPartenaire, dateExercice, dateExercicePre, dureeExercice, dureeExercicePre, monnaieOrigine, dateInsert, partenaire";
|
$fields = "typeBilan, dateProvPartenaire, dateExercice, dateExercicePre, dureeExercice, dureeExercicePre, monnaieOrigine, dateInsert, partenaire, confidentiel, confidentiel_client";
|
||||||
$listeNb = 0;
|
$listeNb = 0;
|
||||||
try {
|
try {
|
||||||
$listeSql = "SELECT $fields FROM jo.bilans WHERE $where";
|
$listeSql = "SELECT $fields FROM jo.bilans WHERE $where";
|
||||||
@ -391,6 +400,8 @@ class Metier_Partenaires_MBilans
|
|||||||
'dureeExercicePre' => $bil['dureeExercicePre'],
|
'dureeExercicePre' => $bil['dureeExercicePre'],
|
||||||
'monnaie' => $bil['monnaieOrigine'],
|
'monnaie' => $bil['monnaieOrigine'],
|
||||||
'source' => $bil['partenaire'],
|
'source' => $bil['partenaire'],
|
||||||
|
'confidentiel' => $bil['confidentiel'],
|
||||||
|
'confidentielClient' => $bil['confidentiel_client'],
|
||||||
);
|
);
|
||||||
$tabTri[''.$bil['dateExercice'].'-'.$bil['typeBilan']] = $bil['typeBilan'].$millesime;
|
$tabTri[''.$bil['dateExercice'].'-'.$bil['typeBilan']] = $bil['typeBilan'].$millesime;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user