feat: Establish core backend services including SQLite database, structured logging, and initial owner management capabilities.
This commit is contained in:
@@ -459,6 +459,33 @@ func (d *DB) UpdateOwnerAccountID(id int64, accountID string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// GetTeamOwnerIDs 获取所有符合条件的 owner ID(用于全选)
|
||||
func (d *DB) GetTeamOwnerIDs(status string) ([]int64, error) {
|
||||
query := "SELECT id FROM team_owners WHERE 1=1"
|
||||
args := []interface{}{}
|
||||
if status != "" {
|
||||
query += " AND status = ?"
|
||||
args = append(args, status)
|
||||
}
|
||||
query += " ORDER BY created_at DESC"
|
||||
|
||||
rows, err := d.db.Query(query, args...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
|
||||
var ids []int64
|
||||
for rows.Next() {
|
||||
var id int64
|
||||
if err := rows.Scan(&id); err != nil {
|
||||
continue
|
||||
}
|
||||
ids = append(ids, id)
|
||||
}
|
||||
return ids, nil
|
||||
}
|
||||
|
||||
// GetOwnerStats 获取统计
|
||||
func (d *DB) GetOwnerStats() map[string]int {
|
||||
stats := map[string]int{
|
||||
|
||||
Reference in New Issue
Block a user