public void saveFormSubmit(string openId, string formId) { tbl_welcomeform welcomeForm = new tbl_welcomeform(); welcomeForm.formId = formId; welcomeForm.openId = openId; welcomeForm.welcomeId = Guid.NewGuid().ToString(); welcomeForm.submitTime = DateTime.Now; SqlSugarClient db = SqlSugarInstance.newInstance(); db.Insertable <tbl_welcomeform>(welcomeForm).ExecuteCommand(); }
public int needToShowMask(string openId) { SqlSugarClient db = SqlSugarInstance.newInstance(); tbl_welcomeform form = db.Queryable <tbl_welcomeform>().Where(o => o.openId == openId).OrderBy(o => o.submitTime, OrderByType.Desc).First(); if (form == null) { return(0); } else if (form.submitTime.AddDays(6) <= DateTime.Now) { return(1); } else { return(2); } }