示例#1
0
def question_list():
    params = get_params()
    state, result, total = list_question_service(params)
    if state:
        return build_ret(success=state, msg='操作成功', total=total, data=result)
    else:
        return err_ret(msg.ERROR(1, "查询失败!"))
示例#2
0
def admin_product_list():
    params = get_params()
    state, result, total = all_product_service(params)
    if state:
        return build_ret(success=state, msg='操作成功', total=total, data=result)
    else:
        return err_ret(msg.ERROR(1, "查询失败!"))
示例#3
0
def admin_report_list():
    params = get_params()
    state, result, total = list_report(params)
    if state:
        return build_ret(success=state, msg='操作成功', total=total, data=result)
    else:
        return err_ret(msg.ERROR(1, "查询失败!"))
示例#4
0
def product_list():
    params = get_params()
    params["user_id"] = get_user_info()["user_id"]
    state, result, total = list_product_service(params)
    if state:
        return build_ret(success=state, msg='操作成功', total=total, data=result)
    else:
        return err_ret(msg.ERROR(1, "查询失败!"))
示例#5
0
def uploads_images():
    if request.method == 'POST':

        date = date_time(fmt="%Y%m%d")

        files = request.files.getlist('file')

        file_urls = []
        for each_file in files:
            if each_file and allowed_file(each_file.filename):
                filename = get_uuid() + '.png'
                files_path = check_file_path(app.config['UPLOAD_FOLDER'], date)
                each_file.save(os.path.join(files_path, filename))
                file_url = web['pic_pix'] + "uploads/" + date + "/" + filename
                file_urls.append(file_url)
        result = {'file_url': file_urls}
        return build_ret(success=True, data=result)
    return html
示例#6
0
def product_detail():
    params = get_params()
    result = detail_product_service(params["id"])

    return build_ret(success=True, msg='操作成功', total=1, data=result)
示例#7
0
def admin_user_charge():
    params = get_params()
    admin_user_balance(params["telephone"], params["money"])
    return build_ret(success=True, msg='操作成功')
示例#8
0
def admin_user_list_():
    params = get_params()
    result, total = admin_user_list(params)
    return build_ret(success=True, msg='操作成功', total=total, data=result)
示例#9
0
def admin_user_list_():
    user_id = get_user_info()["user_id"]
    result = user_info(user_id)
    return build_ret(success=True, msg='操作成功', data=result)