|
@@ -43,9 +43,9 @@ namespace GxPress.Repository.Implement.SystemLabel
|
|
|
/// </summary>
|
|
|
/// <param name="lableId"></param>
|
|
|
/// <returns></returns>
|
|
|
- public async Task<IEnumerable<int>> GetMediaIdsAsync(int lableId)
|
|
|
+ public async Task<IEnumerable<int>> GetMediaIdsAsync(int lableId, int typeValue)
|
|
|
{
|
|
|
- return await _repository.GetAllAsync<int>(Q.Where(nameof(Entity.SystemLabel.SystemLableMedia.LableId), lableId).Select(nameof(Entity.SystemLabel.SystemLableMedia.MediaId)));
|
|
|
+ return await _repository.GetAllAsync<int>(Q.Where(nameof(Entity.SystemLabel.SystemLableMedia.LableId), lableId).Where(nameof(Entity.SystemLabel.SystemLableMedia.TypeValue), typeValue).Select(nameof(Entity.SystemLabel.SystemLableMedia.MediaId)));
|
|
|
}
|
|
|
public async Task<bool> DeleteAsync(List<int> ids)
|
|
|
{
|
|
@@ -63,12 +63,12 @@ namespace GxPress.Repository.Implement.SystemLabel
|
|
|
using (var transactions = new TransactionScope())
|
|
|
{
|
|
|
await _repository.DeleteAsync(Q.Where(nameof(Entity.SystemLabel.SystemLableMedia.LableId), request.LableId));
|
|
|
- var sql = $@"INSERT INTO `tede_system_lable_media`(`Guid`,`CreatedDate`,`LastModifiedDate`,`LableId`,`MediaId`) VALUES";
|
|
|
+ var sql = $@"INSERT INTO `tede_system_lable_media`(`Guid`,`CreatedDate`,`LastModifiedDate`,`LableId`,`MediaId`,`TypeValue`) VALUES";
|
|
|
var createdDate = System.DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
|
|
|
foreach (var item in request.MediaIds)
|
|
|
{
|
|
|
var guid = System.Guid.NewGuid().ToString();
|
|
|
- sql += $@"('{guid}','{createdDate}','{createdDate}',{request.LableId},{item}),";
|
|
|
+ sql += $@"('{guid}','{createdDate}','{createdDate}',{request.LableId},{item},{request.TypeValue}),";
|
|
|
}
|
|
|
sql = sql.Remove(sql.Length - 1, 1);
|
|
|
var databaseType = _databaseTypestr.ToEnum<DatabaseType>(DatabaseType.MySql);
|