You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 2, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: database.go
+25Lines changed: 25 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,31 @@ func seed(db *gorm.DB) {
71
71
Description: "Learn how to install Go on your machine and read the documentation on the Go website.",
72
72
URL: "https://go.dev/learn/",
73
73
},
74
+
{
75
+
Title: "Uberswe on Github",
76
+
Description: "I am the creator of Golang Base Project. This is my Github profile.",
77
+
URL: "https://github.com/uberswe",
78
+
},
79
+
{
80
+
Title: "Tournify",
81
+
Description: "A website to create tournaments or free which uses this project as a base.",
82
+
URL: "https://tournify.io",
83
+
},
84
+
{
85
+
Title: "GORM",
86
+
Description: "The fantastic ORM library for Golang.",
87
+
URL: "https://gorm.io/",
88
+
},
89
+
{
90
+
Title: "Bootstrap",
91
+
Description: "Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.",
92
+
URL: "https://getbootstrap.com/",
93
+
},
94
+
{
95
+
Title: "Gin Web Framework",
96
+
Description: "Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.",
res:=controller.db.Where("title LIKE ? OR description LIKE ?", search, search).Find(&results)
51
+
res:=controller.db.
52
+
Raw(fmt.Sprintf("SELECT * FROM websites WHERE title LIKE ? OR description LIKE ? ORDER BY CASE WHEN title LIKE ? OR description LIKE ? THEN 1 WHEN title LIKE ? OR description LIKE ? THEN 2 WHEN title LIKE ? OR description LIKE ? THEN 4 ELSE 3 END LIMIT %d OFFSET %d", resultsPerPage, resultsPerPage*(page-1)), searchFilter, searchFilter, search, search, search2, search2, search4, search4).
0 commit comments