Added get-headname api
This commit is contained in:
parent
0e8118864d
commit
0c273b85da
1 changed files with 11 additions and 0 deletions
|
|
@ -423,6 +423,17 @@ func connect() {
|
||||||
"result": array,
|
"result": array,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
case "get-headname":
|
||||||
|
err = db.QueryRow("SELECT IFNULL(employeename, '') AS result FROM employee WHERE is_head = 1").Scan(&result)
|
||||||
|
if err != nil {
|
||||||
|
c.AbortWithError(http.StatusBadRequest, err)
|
||||||
|
c.String(http.StatusBadRequest, err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
c.JSON(http.StatusOK, gin.H{
|
||||||
|
"result": result,
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue