public int TodayNewCount() { var today = DateTime.Now; var query = new Wuyiju.Model.User.Query { StartDate = new DateTime(today.Year, today.Month, today.Day, 0, 0, 0), EndDate = new DateTime(today.Year, today.Month, today.Day, 23, 59, 59) }; return(dao.GetCount(query)); }
public int GetCount(Wuyiju.Model.User.Query query) { StringBuilder sql = new StringBuilder(@"select count(*) from ec_user where 1=1 "); sql.AndDateBetween("add_time", "startdate", "enddate"); sql.AndEquals("introducer"); DynamicParameters param = new DynamicParameters(); if (query != null) { param.AddDynamicParams(query); } return(db.ExecuteScalar <int>(sql.ToString(), param)); }