first commit

This commit is contained in:
2025-03-21 11:05:42 +08:00
commit 7dffc94035
1717 changed files with 724764 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
package budget
import (
"context"
"strconv"
db "management/internal/db/sqlc"
"management/internal/global"
)
func AllBudgets(ctx context.Context, projectId int64) []*global.DataDict {
pp, err := db.Engine.ListBudgets(ctx, projectId)
if err != nil || len(pp) == 0 {
return nil
}
var res []*global.DataDict
res = append(res, &global.DataDict{
Name: "请选择",
Value: "0",
})
for _, v := range pp {
item := global.DataDict{
Name: v.Name,
Value: strconv.Itoa(int(v.ID)),
}
res = append(res, &item)
}
return res
}