def get(request): if MallConfig.objects.filter(owner=request.manager).count() == 0: MallConfig.objects.create(owner=request.user, order_expired_day=24) mall_config = MallConfig.objects.filter(owner=request.manager)[0] share_page_config = MallShareOrderPageConfig.objects.filter( owner=request.manager) if share_page_config.count() == 0: share_page_config = MallShareOrderPageConfig.objects.create( owner=request.user, is_share_page=False) else: share_page_config = share_page_config[0] if share_page_config.material_id: news = News.objects.get(material_id=share_page_config.material_id) else: news = None c = RequestContext( request, { 'first_nav_name': FIRST_NAV, 'second_navs': export.get_mall_order_second_navs(request), 'second_nav_name': export.ORDER_EXPIRED_TIME, 'mall_config': mall_config, 'share_page_config': share_page_config, 'news': news }) return render_to_response('mall/editor/edit_expired_time.html', c)
def get(request): """ 显示订单列表 """ c = RequestContext( request, { 'first_nav_name': export.ORDER_FIRST_NAV, 'second_navs': export.get_mall_order_second_navs(request), 'second_nav_name': export.ORDER_MONEY, }) return render_to_response('mall/editor/create_orders_to_money.html', c)
def get(request): if MallConfig.objects.filter(owner=request.manager).count() == 0: MallConfig.objects.create(owner=request.user, order_expired_day=24) mall_config = MallConfig.objects.filter(owner=request.manager)[0] c = RequestContext( request, { 'first_nav_name': FIRST_NAV, 'second_navs': export.get_mall_order_second_navs(request), 'second_nav_name': export.ORDER_EXPIRED_TIME, 'mall_config': mall_config, }) return render_to_response('mall/editor/edit_expired_time.html', c)
def get(request): """ 显示订单列表 """ cost_id = request.GET.get('cost_id', '') cost_status = request.GET.get('cost_status', '') is_weapp = request.GET.get('is_weapp', '') c = RequestContext( request, { 'first_nav_name': export.ORDER_FIRST_NAV, 'second_navs': export.get_mall_order_second_navs(request), 'second_nav_name': export.ORDER_MONEY, 'cost_id': cost_id, 'cost_status': cost_status, 'is_weapp': is_weapp }) return render_to_response('mall/editor/create_orders_to_money.html', c)
def post(request): if not request.POST.get('order_expired_day', 24): order_expired_day = 0 else: order_expired_day = int(request.POST.get('order_expired_day', 24)) if MallConfig.objects.filter(owner=request.manager).count() > 0: MallConfig.objects.filter(owner=request.manager).update( order_expired_day=order_expired_day) else: MallConfig.objects.create(owner=request.user, order_expired_day=24) logging.info(u"user_id:%s, expired_time:%d" % (request.manager.id, order_expired_day)) mall_config = MallConfig.objects.filter(owner=request.manager)[0] c = RequestContext( request, { 'first_nav_name': FIRST_NAV, 'second_navs': export.get_mall_order_second_navs(request), 'second_nav_name': export.ORDER_EXPIRED_TIME, 'mall_config': mall_config, }) return render_to_response('mall/editor/edit_expired_time.html', c)
def post(request): if not request.POST.get('order_expired_day', 24): order_expired_day = 0 else: order_expired_day = int(request.POST.get('order_expired_day', 24)) if MallConfig.objects.filter(owner=request.manager).count() > 0: MallConfig.objects.filter(owner=request.manager).update( order_expired_day=order_expired_day) else: MallConfig.objects.create(owner=request.user, order_expired_day=24) logging.info(u"user_id:%s, expired_time:%d" % (request.manager.id, order_expired_day)) is_share_page = request.POST.get('isShowPage', False) share_background_image = request.POST.get('backgroundImage', '') material_id = request.POST.get('materialId', '') share_image = request.POST.get('shareImage', '') share_describe = request.POST.get('shareInfo', '') share_page_config = MallShareOrderPageConfig.objects.filter( owner=request.manager) if is_share_page: if share_page_config.count() > 0: share_page_config.update( is_share_page=is_share_page, background_image=share_background_image, material_id=material_id, share_image=share_image, share_describe=share_describe) share_page_config = share_page_config[0] else: share_page_config = MallShareOrderPageConfig.objects.create( owner=request.user, is_share_page=is_share_page, background_image=share_background_image, share_image=share_image, share_describe=share_describe, material_id=material_id) else: if share_page_config.count() > 0: share_page_config.update(is_share_page=is_share_page) share_page_config = share_page_config[0] else: share_page_config = MallShareOrderPageConfig.objects.create( owner=request.user, is_share_page=False) if share_page_config.material_id: news = News.objects.get(material_id=share_page_config.material_id) share_page_config.news_id = news.id share_page_config.save() else: news = None mall_config = MallConfig.objects.filter(owner=request.manager)[0] c = RequestContext( request, { 'first_nav_name': FIRST_NAV, 'second_navs': export.get_mall_order_second_navs(request), 'second_nav_name': export.ORDER_EXPIRED_TIME, 'mall_config': mall_config, 'share_page_config': share_page_config, 'news': news }) return render_to_response('mall/editor/edit_expired_time.html', c)
def get(request): """ 显示订单列表 """ belong = request.GET.get("belong", "all") #处理来自“微商城-首页-待发货订单-更多”过来的查看待发货订单的请求 #add by duhao 2015-09-17 order_status = request.GET.get('order_status', '-1') mall_type = request.user_profile.webapp_type woid = request.webapp_owner_id export2data = {} if belong == 'audit': second_nav_name = export.ORDER_AUDIT has_order = util.is_has_order(request, True) page_type = u"财务审核" export_jobs = ExportJob.objects.filter( woid=woid, type=3, is_download=0).order_by("-id") if export_jobs: export2data = { "woid": int(export_jobs[0].woid), # "status": 1 if export_jobs[0].status else 0, "is_download": 1 if export_jobs[0].is_download else 0, "id": int(export_jobs[0].id), # "file_path": export_jobs[0].file_path, } else: second_nav_name = export.ORDER_ALL has_order = util.is_has_order(request) page_type = u"所有订单" export_jobs = ExportJob.objects.filter( woid=woid, type=1, is_download=0).order_by("-id") if export_jobs: export2data = { "woid": int(export_jobs[0].woid), # "status": 1 if export_jobs[0].status else 0, "is_download": 1 if export_jobs[0].is_download else 0, "id": int(export_jobs[0].id), # "file_path": export_jobs[0].file_path, } if not export2data: export2data = { "woid": 0, "status": 1, "is_download": 1, "id": 0, "file_path": 0, } c = RequestContext( request, { 'first_nav_name': FIRST_NAV, 'second_navs': export.get_mall_order_second_navs(request), 'second_nav_name': second_nav_name, 'has_order': has_order, 'page_type': page_type, 'order_status': order_status, 'mall_type': mall_type, 'export2data': export2data, }) return render_to_response('mall/editor/orders.html', c)