作者 陈志颖

refactor:增加合伙人姓名搜索

appname = partner
runmode = "${RUN_MODE||dev}"
httpport = "${HTTP_PORT||8080}"
httpport = "${HTTP_PORT||8082}"
#开启监控
EnableAdmin = false
... ...
... ... @@ -4,7 +4,7 @@ import "os"
var REDIS_HOST = "127.0.0.1"
var REDIS_PORT = "6379"
var REDIS_AUTH = "123456"
var REDIS_AUTH = ""
func init() {
if os.Getenv("REDIS_HOST") != "" {
... ...
... ... @@ -96,6 +96,9 @@ func (dao *PartnerInfoDao) Partners(partnerIds []int64, queryOptions map[string]
if endTime, ok := queryOptions["endTime"]; ok {
filterPartners.WriteString(fmt.Sprintf(" and cooperate_time<to_timestamp(%v)", endTime))
}
if keyword, ok := queryOptions["keyword"]; ok {
filterPartners.WriteString(fmt.Sprintf(" and partner_name LIKE %v", keyword))
}
sql.WriteString(fmt.Sprintf(`
SELECT A.*,B.total,B.amount,COALESCE(B.bonus,0) bonus,B.bonus_expense
... ...
... ... @@ -15,4 +15,6 @@ type PartnersRequest struct {
JoinWays []JoinWays `json:"joinWays"`
// 分红排序(0.从多到少 1.从少到多)
SortBy int `json:"sortBy"`
// 合伙人姓名
Keyword string `json:"keyword"`
}
... ...