花5分钟码完代码,收工睡觉。

modify0322.jpg

    time1, _ := strconv.Atoi(c.PostForm("time1"))
    time2, _ := strconv.Atoi(c.PostForm("time2"))
    shopid, _ := strconv.Atoi(c.PostForm("shopid"))
    if (time1 == 0 && time2 != 0) || (time1 != 0 && time2 == 0) {
        reply.Response(500, "时间参数错误")
        return
    }
    if time1 != 0 {
        extracond += " and o.time>=? and o.time<=?"
        args = append(args, time1, time2)
    }
    if shopid != 0 {
        extracond += " and sd.shopid=?"
        args = append(args, shopid)
    }

标签: none

添加新评论