compnay select
This commit is contained in:
21
app/lib/company/company.go
Normal file
21
app/lib/company/company.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package company
|
||||
|
||||
import (
|
||||
"bordrobot/lib/db"
|
||||
)
|
||||
|
||||
type Company struct {
|
||||
Name string `db:"name"`
|
||||
MemberNumber string `db:"member_number"`
|
||||
Username string `db:"username"`
|
||||
Password string `db:"password"`
|
||||
}
|
||||
|
||||
func (c *Company) Create() error {
|
||||
sq := `
|
||||
insert into company (name, member_number, username, password)
|
||||
VALUES (:name, :member_number, :username, :password)
|
||||
`
|
||||
_, err := db.DB.NamedExec(sq, &c)
|
||||
return err
|
||||
}
|
||||
Reference in New Issue
Block a user