src/ShopBundle/pkgExtranet/objects/db/TShopDataExtranetUser.class.php
public function GetTotalOrderValue($sStartDate = null, $sEndDate = null)
    {
        $query = "SELECT SUM(value_total) AS ordervalue
                  FROM `shop_order`
                 WHERE `data_extranet_user_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($this->id)."'
                   AND (`shop_order`.`id` IS NULL OR `shop_order`.`canceled` = '0')
               ";
        if (!is_null($sStartDate)) {
            $query .= " AND `datecreated` >= '".MySqlLegacySupport::getInstance()->real_escape_string($sStartDate)."' ";
        }
        if (!is_null($sEndDate)) {
            $query .= " AND `datecreated` <= '".MySqlLegacySupport::getInstance()->real_escape_string($sEndDate)."' ";
        }
        $query .= ' GROUP BY `data_extranet_user_id`';
        $dValue = 0;
        if ($aRow = MySqlLegacySupport::getInstance()->fetch_assoc(MySqlLegacySupport::getInstance()->query($query))) {
            $dValue = $aRow['ordervalue'];
        }

        return $dValue;
    }
public function GetTotalOrderValue($sStartDate = null, $sEndDate = null)
    {
        $query = "SELECT SUM(value_total) AS ordervalue
                  FROM `shop_order`
                 WHERE `data_extranet_user_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($this->id)."'
                   AND (`shop_order`.`id` IS NULL OR `shop_order`.`canceled` = '0')
               ";
        if (!is_null($sStartDate)) {
            $query .= " AND `datecreated` >= '".MySqlLegacySupport::getInstance()->real_escape_string($sStartDate)."' ";
        }
        if (!is_null($sEndDate)) {
            $query .= " AND `datecreated` <= '".MySqlLegacySupport::getInstance()->real_escape_string($sEndDate)."' ";
        }
        $query .= ' GROUP BY `data_extranet_user_id`';
        $dValue = 0;
        if ($aRow = MySqlLegacySupport::getInstance()->fetch_assoc(MySqlLegacySupport::getInstance()->query($query))) {
            $dValue = $aRow['ordervalue'];
        }

        return $dValue;
    }
public function GetTotalOrderValue ( $ sStartDate = null , $ sEndDate = null ) { $ query = "SELECT SUM(value_total) AS ordervalue
                  FROM `shop_order`
                 WHERE `data_extranet_user_id` = '" . MySqlLegacySupport :: getInstance ( ) -> real_escape_string ( $ this -> id ) . "'
                   AND (`shop_order`.`id` IS NULL OR `shop_order`.`canceled` = '0')
               " ; if ( ! is_null ( $ sStartDate ) ) { $ query .= " AND `datecreated` >= '" . MySqlLegacySupport :: getInstance ( ) -> real_escape_string ( $ sStartDate ) . "' " ; } if ( ! is_null ( $ sEndDate ) ) { $ query .= " AND `datecreated` <= '" . MySqlLegacySupport :: getInstance ( ) -> real_escape_string ( $ sEndDate ) . "' " ; } $ query .= ' GROUP BY `data_extranet_user_id`' ; $ dValue = 0 ; if ( $ aRow = MySqlLegacySupport :: getInstance ( ) -> fetch_assoc ( MySqlLegacySupport :: getInstance ( ) -> query ( $ query ) ) ) { $ dValue = $ aRow [ 'ordervalue' ] ; } return $ dValue ; }
return the total order value of the customer.

@param string|null $sStartDate
@param string|null $sEndDate

@return float
return the total order value of the customer .