wzp
2021-09-01 2891fe0769189be39c9634b2cbc1841dbd52d022
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FineAdmin.Common;
using FineAdmin.IService;
using FineAdmin.Model;
 
namespace FineAdmin.Service
{
    public class LogonLogService : BaseService<LogonLogModel>, ILogonLogService
    {
        public dynamic GetListByFilter(LogonLogModel filter, PageInfo pageInfo)
        {
            string _where = " where 1=1";
            if (!string.IsNullOrEmpty(filter.Account))
            {
                _where += " and Account=:Account";
            }
            if (!string.IsNullOrEmpty(filter.RealName))
            {
                _where += " and RealName=:RealName";
            }
            _where = CreateTimeWhereStr(filter.StartEndDate, _where);
            return GetListByFilter(filter, pageInfo, _where);
        }
 
        /// <summary>
        /// 写入登录日志
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int WriteDbLog(LogonLogModel model)
        {
            model.IPAddress = Net.Ip;
            model.IPAddressName = Net.GetLocation(model.IPAddress);
            model.CreateTime = DateTime.Now;
            return BaseRepository.Insert(model);
        }
    }
}