()
改变用户状态
改变用户状态
改变用户状态
def change_status_user():
    """ 改变用户状态 """
    data = request.json
    ids = data.get('id')
    _edit = User.query.filter_by(id=ids).first()
    if _edit.status == 1:
        _edit.status = 0
        db.session.commit()
        return jsonify({'msg': '冻结成功', 'status': 1})
    else:
        _edit.status = 1
        db.session.commit()
        return jsonify({'msg': '恢复成功', 'status': 1})
def change_status_user ( ) : data = request . json ids = data . get ( 'id' ) _edit = User . query . filter_by ( id = ids ) . first ( ) if _edit . status == 1 : _edit . status = 0 db . session . commit ( ) return jsonify ( { 'msg' : '冻结成功', 'statu s : 1}) else : _edit . status = 1 db . session . commit ( ) return jsonify ( { 'msg' : '恢复成功', 'statu s : 1})