From d3069b73a44348984ed3c4744914d5ceab802d2f Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 17 Mar 2023 16:39:41 +0100 Subject: [PATCH] xdebug docker fix, bugfix manager console --- .docker/Dockerfile | 2 +- .../teamdata/TB_Shared_Ent_TeamData_Contract.php | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 733a4f0..172dfd2 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -26,7 +26,7 @@ RUN apt-get install mariadb-client -y RUN apt install nano -RUN pecl install xdebug \ +RUN pecl install xdebug-3.1.5 \ && docker-php-ext-enable xdebug \ && echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ && echo "xdebug.client_host = host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ diff --git a/src/server/shared/ent/teamdata/TB_Shared_Ent_TeamData_Contract.php b/src/server/shared/ent/teamdata/TB_Shared_Ent_TeamData_Contract.php index e948c83..fa02c62 100644 --- a/src/server/shared/ent/teamdata/TB_Shared_Ent_TeamData_Contract.php +++ b/src/server/shared/ent/teamdata/TB_Shared_Ent_TeamData_Contract.php @@ -186,12 +186,19 @@ class TB_Shared_Ent_TeamData_Contract extends Francis_Db_Row if ( 0 < count( $appIds ) ) { $in = str_repeat('?,', count( $appIds ) - 1 ) . '?'; - $sql = "SELECT SUM( price_factor ) AS `current_total` FROM `appointment` WHERE "; + $sql = "SELECT * FROM `appointment` WHERE "; $sql .= "id IN ( $in )"; $stmt = $dbh->prepare( $sql ); $stmt->execute( $appIds ); - $rowSum = $stmt->fetch( PDO::FETCH_ASSOC ); - $sumPriceFactor = $rowSum[ 'current_total' ]; + + $appointments = $stmt->fetchAll(PDO::FETCH_ASSOC); + $appointmentsById = []; + foreach ($appointments as $app) { + $appointmentsById[$app['id']] = $app; + } + foreach ($appIds as $appId) { + $sumPriceFactor += $appointmentsById[$appId]['price_factor']; + } } $contract = TB_Shared_Ent_TeamData_Contract::get( $contractId );