|
@@ -1,4 +1,5 @@
|
|
|
using Hotline.Share.Dtos.Snapshot;
|
|
|
+using Hotline.Share.Tools;
|
|
|
using Hotline.Snapshot;
|
|
|
using Hotline.Snapshot.Interfaces;
|
|
|
using Hotline.Tools;
|
|
@@ -38,6 +39,26 @@ public class InviteCodeApplication : IInviteCodeApplication, IScopeDependency
|
|
|
await _inviteCodeRepository.AddAsync(entity);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 删除邀请码
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="ids"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task DeleteInviteCodeAsync(IList<string> ids)
|
|
|
+ {
|
|
|
+ await _inviteCodeRepository.Queryable()
|
|
|
+ .Where(m => ids.Contains(m.Id))
|
|
|
+ .ToListAsync()
|
|
|
+ .Then(async invite =>
|
|
|
+ {
|
|
|
+ for (int i = 0;i < invite.Count;i++)
|
|
|
+ {
|
|
|
+ invite[i].IsDeleted = true;
|
|
|
+ await _inviteCodeRepository.UpdateAsync(invite[i]);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
public ISugarQueryable<InviteCode> GetInviteCodeItemsAsync()
|
|
|
{
|
|
|
return _inviteCodeRepository.Queryable();
|
|
@@ -69,7 +90,13 @@ public class InviteCodeApplication : IInviteCodeApplication, IScopeDependency
|
|
|
dto.ValidateObject();
|
|
|
var query = _inviteCodeRecordRepository.Queryable()
|
|
|
.Where(m => m.CreationTime >= dto.StartTime && m.CreationTime <= dto.EndTime && m.OrgId == dto.OrgId)
|
|
|
- .Select(m => new InviteCodeStatisticDetailOutDto());
|
|
|
+ .WhereIF(dto.Name.NotNullOrEmpty(), m => m.Name.Contains(dto.Name))
|
|
|
+ .WhereIF(dto.PhoneNumber.NotNullOrEmpty(), m => m.PhoneNumber.Contains(dto.PhoneNumber))
|
|
|
+ .WhereIF(dto.InviteCode.NotNullOrEmpty(), m => m.InviteCode.Contains(dto.InviteCode))
|
|
|
+ .Select(m => new InviteCodeStatisticDetailOutDto
|
|
|
+ {
|
|
|
+ OpenId = m.WXOpenId
|
|
|
+ }, true);
|
|
|
return query;
|
|
|
}
|
|
|
|