|
@@ -39,7 +39,6 @@ func (this *Client) Index() {
|
|
|
// if (*data)["i_state"] == 1 {
|
|
|
tagRule, _ := Mgo.Find("eusertagrule", map[string]interface{}{"s_userid": id, "b_delete": false}, nil, nil, false, -1, -1)
|
|
|
this.T["tagrule"] = *tagRule
|
|
|
- log.Println(tagRule)
|
|
|
appid := qu.ObjToString((*data)["s_appid"])
|
|
|
mails, _ := MgoCus.FindOneByField("user", map[string]interface{}{"appid": appid}, `{"mails":1,"username":1}`)
|
|
|
this.T["mails"] = mails
|
|
@@ -123,12 +122,25 @@ func (c *Client) CuserRuleDel() {
|
|
|
func (c *Client) DepartDel() {
|
|
|
defer qu.Catch()
|
|
|
_id := c.GetString("id")
|
|
|
- set := bson.M{
|
|
|
- "$set": bson.M{
|
|
|
- "b_delete": true,
|
|
|
- },
|
|
|
+ ids := strings.Split(_id, ",")
|
|
|
+ update := [][]map[string]interface{}{}
|
|
|
+ for _, v := range ids {
|
|
|
+ idAndSet := []map[string]interface{}{}
|
|
|
+ idAndSet = append(idAndSet, bson.M{"_id": mongoutil.StringTOBsonId(v)}) //查询条件
|
|
|
+ idAndSet = append(idAndSet, bson.M{"$set": bson.M{"b_delete": true}}) //修改的数据
|
|
|
+ update = append(update, idAndSet)
|
|
|
+ /*update = append(update, []map[string]interface{}{
|
|
|
+ map[string]interface{}{
|
|
|
+ "_id": mongoutil.StringTOBsonId(v),
|
|
|
+ },
|
|
|
+ map[string]interface{}{
|
|
|
+ "$set": map[string]interface{}{
|
|
|
+ "b_delete": true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ })*/
|
|
|
}
|
|
|
- b := Mgo.UpdateById("cuserdepart", _id, set)
|
|
|
+ b := Mgo.UpdateBulk("cuserdepart", update...)
|
|
|
c.ServeJson(map[string]interface{}{
|
|
|
"rep": b,
|
|
|
})
|