|
@@ -484,16 +484,15 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
|
|
|
if in.Current_page <= 0 {
|
|
|
in.Current_page = 1
|
|
|
}
|
|
|
- logx.Info(fmt.Sprintf("%+v", in))
|
|
|
- args := []interface{}{in.PositionId, in.PositionId, in.PositionId}
|
|
|
+ sqlAppendArgs := []interface{}{}
|
|
|
sqlAppend1 := ""
|
|
|
if in.Type != "" {
|
|
|
sqlAppend1 += ` and a.itype=?`
|
|
|
- args = append(args, n.TypeStrConvert(in.Type))
|
|
|
+ sqlAppendArgs = append(sqlAppendArgs, n.TypeStrConvert(in.Type))
|
|
|
}
|
|
|
if in.Starttime != "" {
|
|
|
sqlAppend1 += ` and a.create_time>=?`
|
|
|
- args = append(args, in.Starttime+" 00:00:00")
|
|
|
+ sqlAppendArgs = append(sqlAppendArgs, in.Starttime+" 00:00:00")
|
|
|
}
|
|
|
if in.Endtime != "" {
|
|
|
sqlAppend1 += ` and a.create_time<=?`
|
|
@@ -502,19 +501,23 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
|
|
|
} else {
|
|
|
in.Endtime += " 00:00:00"
|
|
|
}
|
|
|
- args = append(args, in.Endtime)
|
|
|
+ sqlAppendArgs = append(sqlAppendArgs, in.Endtime)
|
|
|
}
|
|
|
if in.Name != "" {
|
|
|
sqlAppend1 += ` and a.company_name like ?`
|
|
|
- args = append(args, "%"+in.Name+"%")
|
|
|
+ sqlAppendArgs = append(sqlAppendArgs, "%"+in.Name+"%")
|
|
|
}
|
|
|
var count int64
|
|
|
start := (in.Current_page - 1) * in.Page_size
|
|
|
end := start + in.Page_size
|
|
|
dbPaging := in.Buyercount_start == 0 && in.Buyercount_end == 0 && in.Monitor == 0 && in.Monitorcount_start == 0 && in.Monitorcount_end == 0 && in.Project_matchme == 0 && in.Order_amount == 0
|
|
|
+ args := []interface{}{in.PositionId, in.PositionId, in.PositionId}
|
|
|
+ args = append(args, sqlAppendArgs...)
|
|
|
sqlAppend2 := ""
|
|
|
if dbPaging {
|
|
|
- count = CrmMysql.CountBySql(`select count(1) as count from crm.connection a where a.position_id=?`+sqlAppend1, args...)
|
|
|
+ newArgs := []interface{}{in.PositionId}
|
|
|
+ newArgs = append(newArgs, sqlAppendArgs...)
|
|
|
+ count = CrmMysql.CountBySql(`select count(1) as count from crm.connection a where a.position_id=?`+sqlAppend1, newArgs...)
|
|
|
sqlAppend2 = ` limit ?,?`
|
|
|
args = append(args, start, end)
|
|
|
}
|