1
This commit is contained in:
		
							parent
							
								
									3e1995bf3d
								
							
						
					
					
						commit
						f2778426b3
					
				@ -84,7 +84,7 @@ namespace asg_form.Controllers.Budget
 | 
				
			|||||||
                    used_event_id = msg.usedEventId,
 | 
					                    used_event_id = msg.usedEventId,
 | 
				
			||||||
                    use_status = "0",
 | 
					                    use_status = "0",
 | 
				
			||||||
                    update_person = msg.updatePerson,
 | 
					                    update_person = msg.updatePerson,
 | 
				
			||||||
                    update_time = dateString,
 | 
					                    update_time = null,
 | 
				
			||||||
                };
 | 
					                };
 | 
				
			||||||
                sub.budgetDetails.Add(budget);
 | 
					                sub.budgetDetails.Add(budget);
 | 
				
			||||||
                await sub.SaveChangesAsync();
 | 
					                await sub.SaveChangesAsync();
 | 
				
			||||||
@ -185,7 +185,7 @@ namespace asg_form.Controllers.Budget
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
            catch (Exception ex)
 | 
					            catch (Exception ex)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                return StatusCode(500, new { code = 500, message = "服务器错误", details = ex.Message });
 | 
					                return Ok(new { code = 500, message = "服务器错误", details = ex.Message });
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -211,8 +211,9 @@ namespace asg_form.Controllers.Budget
 | 
				
			|||||||
                using (var db = new TestDbContext())
 | 
					                using (var db = new TestDbContext())
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    var budgetTotals = await (from e in db.events
 | 
					                    var budgetTotals = await (from e in db.events
 | 
				
			||||||
                                              join b in db.budgetDetails on e.Id equals b.source_event_id
 | 
					                                              join b in db.budgetDetails on e.Id equals b.source_event_id into budgetGroup
 | 
				
			||||||
                                              group b by new
 | 
					                                              from bg in budgetGroup.DefaultIfEmpty()
 | 
				
			||||||
 | 
					                                              group bg by new
 | 
				
			||||||
                                              {
 | 
					                                              {
 | 
				
			||||||
                                                  e.Id,
 | 
					                                                  e.Id,
 | 
				
			||||||
                                                  e.name
 | 
					                                                  e.name
 | 
				
			||||||
@ -221,7 +222,7 @@ namespace asg_form.Controllers.Budget
 | 
				
			|||||||
                                              {
 | 
					                                              {
 | 
				
			||||||
                                                  sourceEventId = g.Key.Id,
 | 
					                                                  sourceEventId = g.Key.Id,
 | 
				
			||||||
                                                  sourceEventName = g.Key.name,
 | 
					                                                  sourceEventName = g.Key.name,
 | 
				
			||||||
                                                  budgetTotalMoney = g.Sum(b => b.budget_money)
 | 
					                                                  budgetTotalMoney = g.Sum(b => b == null ? 0 : b.budget_money)
 | 
				
			||||||
                                              }).ToListAsync();
 | 
					                                              }).ToListAsync();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    return Ok(new
 | 
					                    return Ok(new
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user