|
@@ -135,5 +135,40 @@ namespace GxPress.Service.Implement.PlatformData
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 平台内容数据
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<PlatformContentDataResult> GetPlatformContentDataResult()
|
|
|
+ {
|
|
|
+ var connectionString = ConfigHelper.GetValue("Database:ConnectionString");
|
|
|
+ var database = new Database(DatabaseType.MySql, connectionString);
|
|
|
+ var connection = database.GetConnection();
|
|
|
+ var nowTime = DateTime.Now.ToString("yyyy-MM-dd");
|
|
|
+ var sql = $@"SELECT
|
|
|
+ (SELECT
|
|
|
+ COUNT(1)
|
|
|
+ FROM
|
|
|
+ tede_media) AS SumContentCount,
|
|
|
+ (SELECT
|
|
|
+ COUNT(1)
|
|
|
+ FROM
|
|
|
+ tede_media
|
|
|
+ WHERE
|
|
|
+ CreatedDate > '{nowTime}') AS NewContentCount,
|
|
|
+ (SELECT
|
|
|
+ COUNT(1)
|
|
|
+ FROM
|
|
|
+ tede_media
|
|
|
+ WHERE
|
|
|
+ IsChecked=1 and IsDelete=0) AS OnlineContentCount,
|
|
|
+ (SELECT
|
|
|
+ COUNT(1)
|
|
|
+ FROM
|
|
|
+ tede_media
|
|
|
+ WHERE
|
|
|
+ FreeProportion>0) AS PayContentCount";
|
|
|
+ return await connection.QueryFirstAsync<PlatformContentDataResult>(sql);
|
|
|
+ }
|
|
|
}
|
|
|
}
|