李昊 4 år sedan
förälder
incheckning
090ef1839b

+ 3 - 3
gx_api/GxPress/Service/GxPress.Service.Implement/PlatformData/PlatformDataService.Commerce.cs

@@ -27,7 +27,7 @@ namespace GxPress.Service.Implement.PlatformData
             var nowTime = DateTime.Now.ToString("yyyy-MM-dd");
             var sql = $@"SELECT 
                         (SELECT 
-                                SUM(Price)
+                                IFNULL(SUM(Price),0)
                             FROM
                                 tede_order where CreatedDate>'{nowTime}') AS Amount,
                         (SELECT 
@@ -39,12 +39,12 @@ namespace GxPress.Service.Implement.PlatformData
                             FROM
                                 tede_user where CreatedDate>'{nowTime}') AS VipUserCount,
                         (SELECT 
-                                SUM(Price)
+                                IFNULL(SUM(Price),0)
                             FROM
                                 tede_order
                             WHERE
                                 IsVip = 1 and CreatedDate>'{nowTime}') AS VipAmount";
-            var connectionString = ConfigHelper.GetValue("Database: ConnectionString");
+            var connectionString = ConfigHelper.GetValue("Database:ConnectionString");
             var database = new Database(DatabaseType.MySql, connectionString);
             var connection = database.GetConnection();
             return await connection.QueryFirstAsync<PlatformCommerceResult>(sql);

+ 1 - 0
gx_api/GxPress/Service/GxPress.Service.Interface/PlatformData/IPlatformDataService.cs

@@ -86,5 +86,6 @@ namespace GxPress.Service.Interface.PlatformData
         /// </summary>
         /// <returns></returns>
          Task<CommerceDataResult> GetCommerceDataResult();
+         Task<PlatformCommerceResult> GetPlatformTodayCommerceResult();
     }
 }