def good_list(request, page):
    page = int(page)
    type = request.GET.get('type')
    keyword = request.GET.get('keyword')
    goods_list = []
    if (type == 'byid'):
        if keyword:
            types = GoodsType.objects.get(id=int(keyword))
            goods_list = types.goods_set.order_by('goods_pro_date')
    elif (type == 'bykey'):
        if keyword:
            goods_list = Goods.objects.filter(goods_name__contains=keyword).order_by('goods_pro_date')
    if goods_list:
        page_list = Paginator(goods_list, 15)
        goods_list = page_list.page(page)
        pages = page_list.page_range
        nums = len(goods_list)
        nums = int(math.ceil((nums / 5)))
        recommon_list = goods_list[:nums]
    return render(request, 'buyer/goods_list.html', locals())
def good_list(request, page):
    page = int(page)
    type = request.GET.get('type')
    keyword = request.GET.get('keyword')
    goods_list = []
    if (type == 'byid'):
        if keyword:
            types = GoodsType.objects.get(id=int(keyword))
            goods_list = types.goods_set.order_by('goods_pro_date')
    elif (type == 'bykey'):
        if keyword:
            goods_list = Goods.objects.filter(goods_name__contains=keyword).order_by('goods_pro_date')
    if goods_list:
        page_list = Paginator(goods_list, 15)
        goods_list = page_list.page(page)
        pages = page_list.page_range
        nums = len(goods_list)
        nums = int(math.ceil((nums / 5)))
        recommon_list = goods_list[:nums]
    return render(request, 'buyer/goods_list.html', locals())