fix Count Debug
This commit is contained in:
		
							parent
							
								
									45ccb13437
								
							
						
					
					
						commit
						2bd6928400
					
				
							
								
								
									
										7
									
								
								scope.go
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								scope.go
									
									
									
									
									
								
							@ -940,7 +940,12 @@ func (scope *Scope) pluck(column string, value interface{}) *Scope {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func (scope *Scope) count(value interface{}) *Scope {
 | 
					func (scope *Scope) count(value interface{}) *Scope {
 | 
				
			||||||
	if query, ok := scope.Search.selects["query"]; !ok || !countingQueryRegexp.MatchString(fmt.Sprint(query)) {
 | 
						if query, ok := scope.Search.selects["query"]; !ok || !countingQueryRegexp.MatchString(fmt.Sprint(query)) {
 | 
				
			||||||
		scope.Search.Select("count(*)")
 | 
							if len(scope.Search.group) != 0 {
 | 
				
			||||||
 | 
								scope.Search.Select("count(*) FROM ( SELECT count(*) ")
 | 
				
			||||||
 | 
								scope.Search.group += " ) AS count"
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								scope.Search.Select("count(*)")
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	scope.Search.ignoreOrderQuery = true
 | 
						scope.Search.ignoreOrderQuery = true
 | 
				
			||||||
	scope.Err(scope.row().Scan(value))
 | 
						scope.Err(scope.row().Scan(value))
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user