Exemple #1
0
def search_name_card(page, count_of_page):
    """
    搜索名片接口
    :param page: 页数
    :param count_of_page: 每页记录数
    @author: yubang
    :return:
    """
    industry = request.form.get('industry', None)
    role = request.form.get('role', None)
    search_key = request.form.get('search_key', None)

    if search_key is None or industry is None or role is None:
        return abort(404)

    objs, nums, max_page = BusinessCardModel.search_cards(
        g.open_id, industry.encode("UTF-8"), role.encode("UTF-8"),
        search_key.encode("UTF-8"), page, count_of_page)
    response = make_response(
        json.dumps({
            "objs": objs,
            "nums": nums,
            "max_page": max_page
        }))
    response.headers['Content-Type'] = 'application/json'
    return response
Exemple #2
0
def search_name_card(page, count_of_page):
    """
    搜索名片接口
    :param page: 页数
    :param count_of_page: 每页记录数
    @author: yubang
    :return:
    """
    name = request.form.get('name', None)
    company = request.form.get('company', None)
    resources_label = request.form.get('resources_label', None)
    resources_key = request.form.get('resources_key', None)

    objs, nums, max_page = BusinessCardModel.search_cards(g.open_id, name, company, resources_label, resources_key, page, count_of_page)
    response = make_response(json.dumps({"objs": objs, "nums": nums, "max_page": max_page}))
    response.headers['Content-Type'] = 'application/json'
    return response
Exemple #3
0
def search_name_card(page, count_of_page):
    """
    搜索名片接口
    :param page: 页数
    :param count_of_page: 每页记录数
    @author: yubang
    :return:
    """
    name = request.form.get('name', None)
    company = request.form.get('company', None)
    resources_label = request.form.get('resources_label', None)
    resources_key = request.form.get('resources_key', None)

    objs, nums, max_page = BusinessCardModel.search_cards(
        g.open_id, name, company, resources_label, resources_key, page,
        count_of_page)
    response = make_response(
        json.dumps({
            "objs": objs,
            "nums": nums,
            "max_page": max_page
        }))
    response.headers['Content-Type'] = 'application/json'
    return response