初步版本修正
This commit is contained in:
@@ -18,17 +18,23 @@ var OrderCtr = Ctr{
|
||||
that.Display(3, "请求参数异常")
|
||||
return
|
||||
}
|
||||
salesman := that.Db.Get("salesman", "*", Map{"id": that.Session("salesman_id").Data})
|
||||
if salesman == nil {
|
||||
that.Display(2, "登录错误")
|
||||
return
|
||||
}
|
||||
|
||||
res := that.Db.Get("order", "*", Map{"id": id})
|
||||
res := that.Db.Get("order", "*", Map{"AND": Map{"id": id, "provider_id": salesman.GetCeilInt64("provider_id")}})
|
||||
|
||||
if res == nil {
|
||||
that.Display(4, "找不到对应订单")
|
||||
return
|
||||
}
|
||||
if res.GetCeilInt("salesman_id") != that.Session("salesman_id").ToCeilInt() {
|
||||
that.Display(4, "不是你的订单")
|
||||
return
|
||||
}
|
||||
|
||||
//if res.GetCeilInt("salesman_id") != that.Session("salesman_id").ToCeilInt() {
|
||||
// that.Display(4, "不是你的订单")
|
||||
// return
|
||||
//}
|
||||
|
||||
if res.GetCeilInt("user_id") > 0 {
|
||||
res["user"] = that.Db.Get("user", "name,nickname,avatar", Map{"id": res.GetCeilInt("user_id")})
|
||||
@@ -59,7 +65,7 @@ var OrderCtr = Ctr{
|
||||
return
|
||||
}
|
||||
|
||||
order := that.Db.Get("order", "*", Map{"AND": Map{"id": id, "salesman_id": that.Session("salesman_id").Data}})
|
||||
order := that.Db.Get("order", "*", Map{"AND": Map{"id": id, "provider_id": salesman.GetCeilInt64("provider_id")}})
|
||||
if order == nil {
|
||||
that.Display(4, "不是属于你的订单")
|
||||
return
|
||||
@@ -129,7 +135,7 @@ var OrderCtr = Ctr{
|
||||
data["declare_id"] = declareId
|
||||
}
|
||||
|
||||
order := that.Db.Get("order", "*", Map{"AND": Map{"id": id, "salesman_id": that.Session("salesman_id").Data}})
|
||||
order := that.Db.Get("order", "*", Map{"AND": Map{"id": id, "provider_id": salesman.GetCeilInt64("provider_id")}})
|
||||
if order == nil {
|
||||
that.Display(4, "不是属于你的订单")
|
||||
return
|
||||
@@ -178,7 +184,13 @@ var OrderCtr = Ctr{
|
||||
pageSize = 20
|
||||
}
|
||||
|
||||
data := Map{"del_flag": 0, "salesman_id": that.Session("salesman_id").Data}
|
||||
salesman := that.Db.Get("salesman", "*", Map{"id": that.Session("salesman_id").Data})
|
||||
if salesman == nil {
|
||||
that.Display(2, "登录错误")
|
||||
return
|
||||
}
|
||||
|
||||
data := Map{"del_flag": 0, "provider_id": salesman.GetCeilInt64("provider_id")}
|
||||
keywords := that.Req.FormValue("keywords")
|
||||
if keywords != "" {
|
||||
data["OR"] = Map{"sn[~]": keywords, "name[~]": keywords}
|
||||
|
||||
Reference in New Issue
Block a user