some mirror fixed
This commit is contained in:
2
install.sh
Normal file
2
install.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
env GOBIN=/usr/local/bin go install ./cmd
|
||||||
@@ -67,6 +67,11 @@ func BatchInsertOnDuplicate(entries []model.ExternalSources, db *sqlx.DB, column
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (f *ExternalSources) GetTypeIds(entries []model.ExternalSources, db *sqlx.DB) []int {
|
func (f *ExternalSources) GetTypeIds(entries []model.ExternalSources, db *sqlx.DB) []int {
|
||||||
|
if len(entries) == 0 {
|
||||||
|
fmt.Printf("Entries are empty")
|
||||||
|
return nil // або логування помилки
|
||||||
|
}
|
||||||
|
|
||||||
var typeIds []int
|
var typeIds []int
|
||||||
ids := thither.FieldValueToStrSlice(entries, "TypeId")
|
ids := thither.FieldValueToStrSlice(entries, "TypeId")
|
||||||
query := fmt.Sprintf("SELECT type_id FROM %s WHERE `type` = '%s' AND type_id IN (%s) LIMIT %d", constant.ExternalSourcesTable, entries[0].Type, strings.Join(ids, ","), len(ids))
|
query := fmt.Sprintf("SELECT type_id FROM %s WHERE `type` = '%s' AND type_id IN (%s) LIMIT %d", constant.ExternalSourcesTable, entries[0].Type, strings.Join(ids, ","), len(ids))
|
||||||
|
|||||||
Reference in New Issue
Block a user