|
@@ -19,7 +19,7 @@ type ReportProjectInfoParam struct {
|
|
|
BuyerClass []string `json:"buyerClass"` // 采购单位类型
|
|
|
Buyer string `json:"buyer"` // 采购单位
|
|
|
Winner string `json:"winner"` // 中标单位
|
|
|
- Sort int `json:"sort"` // 排序默认0:成交时间倒序;1:项目金额倒序
|
|
|
+ Sort int `json:"sort"` // 排序默认0:项目更新时间倒序;1:项目金额倒序
|
|
|
Start int `json:"start"` // 开始时间
|
|
|
End int `json:"end"` // 结束时间
|
|
|
PageSize int `json:"pageSize"` // 默认每页10条
|
|
@@ -149,3 +149,31 @@ func ReportProjectInfoFormat(data []map[string]interface{}) []map[string]interfa
|
|
|
}
|
|
|
return rs
|
|
|
}
|
|
|
+
|
|
|
+// ReportGetArea 周报月报获取当前订阅地区
|
|
|
+func ReportGetArea(positionId, start, end int64) map[string]interface{} {
|
|
|
+ q := "SELECT area,group_concat(city) as city from " + TableMemberReportProject + " where position_id =? and start_time >=? and end_time<=? group by area;"
|
|
|
+ rs := db.Base.SelectBySql(q, positionId, start, end)
|
|
|
+ areaMap := map[string]interface{}{}
|
|
|
+ if rs != nil && len(*rs) > 0 {
|
|
|
+ for i := 0; i < len(*rs); i++ {
|
|
|
+ area := common.ObjToString((*rs)[i]["area"])
|
|
|
+ city := strings.Split(common.ObjToString((*rs)[i]["city"]), ",")
|
|
|
+ areaMap[area] = city
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return areaMap
|
|
|
+}
|
|
|
+
|
|
|
+// ReportGetBuyerClass 周报月报获取当前采购单位类型
|
|
|
+func ReportGetBuyerClass(positionId, start, end int64) []string {
|
|
|
+ buyerClass := []string{}
|
|
|
+ q := "select distinct(buyerclass) from " + TableMemberReportProject + " where position_id =? and start_time >=? and end_time<=?"
|
|
|
+ rs := db.Base.SelectBySql(q, positionId, start, end)
|
|
|
+ if rs != nil && len(*rs) > 0 {
|
|
|
+ for i := 0; i < len(*rs); i++ {
|
|
|
+ buyerClass = append(buyerClass, common.ObjToString((*rs)[i]["buyerclass"]))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return buyerClass
|
|
|
+}
|