示例#1
0
 def delete(self):
     # 参数
     req = self.request()
     data = Inc.json_decode(req.get('data'))
     if not data:
         return self.getJSON({'code': 4000, 'msg': '参数错误!'})
     # ID
     ids = Inc.implode(',', data)
     model = UserRole()
     model.where('id in(:ids:)', {'ids': ids})
     # 结果
     if model.delete():
         return self.getJSON({'code': 0, 'msg': '成功'})
     else:
         return self.getJSON({'code': 5000, 'msg': '删除失败!'})
示例#2
0
 def delete(self):
     # 验证
     AdminToken().urlVerify('SysMenusAction')
     # 参数
     req = self.request()
     data = Inc.json_decode(req.get('data'))
     if not data:
         return self.getJSON({'code': 4000, 'msg': '参数错误!'})
     # ID
     ids = Inc.implode(',', data)
     model = SysMenuAction()
     model.where('id in(:ids:)', {'ids': ids})
     # 结果
     if model.delete():
         return self.getJSON({'code': 0, 'msg': '成功'})
     else:
         return self.getJSON({'code': 5000, 'msg': '删除失败!'})
示例#3
0
 def delete(self):
   # 参数
   req = self.request()
   data = Inc.json_decode(req.get('data'))
   if not data :
     return self.getJSON({'code':4000,'msg':'参数错误!'})
   # 管理员
   if '1' in data or 1 in data :
     return self.getJSON({'code':4000,'msg':'无法删除系统管理员!'})
   # ID
   ids = Inc.implode(',',data)
   user = {'where':'id in(:uid:)','bind':{'uid':ids}}
   uinfo = {'where':'uid in(:uid:)','bind':{'uid':ids}}
   # 结果
   if User().delete(user) and UserInfo().delete(uinfo) :
     return self.getJSON({'code':0,'msg':'成功'})
   else :
     return self.getJSON({'code':5000,'msg':'删除失败!'})