()
return jsonify({'msg': '置顶完成', 'status': 1})
置顶模块
置顶模块
置顶模块
def stick_module():
    """ 置顶模块 """
    data = request.json
    module_id = data.get('id')
    project_id = data.get('projectId')
    old_data = Module.query.filter_by(id=module_id).first()
    old_num = old_data.num
    list_data = Module.query.filter_by(project_id=project_id).all()
    num_sort(1, old_num, list_data, old_data)
    db.session.commit()
    return jsonify({'msg': '置顶完成', 'status': 1})
def stick_module ( ) : data = request . json module_id = data . get ( 'id' ) project_id = data . get ( 'projectId' ) old_data = Module . query . filter_by ( id = module_id ) . first ( ) old_num = old_data . num list_data = Module . query . filter_by ( project_id = project_id ) . all ( ) num_sort ( 1 , old_num , list_data , old_data ) db . session . commit ( ) return jsonify ( { 'msg' : '置顶完成', 'statu s : 1})