/// <summary> /// 创建账户明细 /// </summary> /// <param name="model"></param> /// <returns></returns> public async Task <string> CreateAccountDetail(MealAccountDetailModel model) { using (var conn = MySqlHelper.GetConnection()) { return(await conn.InsertAsync <string, MealAccountDetailModel>(model)); } }
/// <summary> /// 更新用户账户身份 /// </summary> /// <param name="requestDto"></param> /// <returns></returns> public async Task <bool> UpdateAccountIdentity(List <MealAccountModel> addModels, List <MealAccountModel> updateModels, MealAccountDetailModel addAccountDetailModel) { return(await MySqlHelper.TransactionAsync(async (conn, tran) => { // 添加账户信息 if (addModels != null && addModels.Count > 0) { await CreateAccount(conn, addModels); } // 更新账户状态 if (updateModels != null) { await UpdateAccounts(conn, updateModels); } // 添加账户清零明细 if (addAccountDetailModel != null) { await conn.InsertAsync <string, MealAccountDetailModel>(addAccountDetailModel); } return true; })); }