def get(self, series_id):
        try:
            series_service, company_service = WeddingCompanySeriesService(), CompanyServices()
            series_service.set_db(self.db)
            company_service.set_db(self.db)

            series = series_service.query_series(series_id=series_id).scalar()
            images = series_service.query_series_images(series_id=series_id)
            recommend_series = series_service.query_series(order_by='Fcreate_time').limit(3).offset(0)

            conpany = company_service.get_company_by_uid(series.Fmerchant_id)           #公司信息
            company_gift = company_service.get_gift(series.Fmerchant_id,1).scalar()     #到店礼
            order_gift = company_service.get_gift(series.Fmerchant_id,2).scalar()       #订单礼
            #1.商户订单,2.套系订单 3.作品订单
            order_url = '/order/create/2/'+str(series_id)+'/'+str(conpany.Fuser_id)
            self.echo('view/weddingCompany/series_detail.html',{
                'series':series,
                'recommend_series':recommend_series,
                'company':conpany,
                'order_gift':order_gift,
                'company_gift':company_gift,
                'images':images,
                'order_url':order_url
            })

        except Exception, e:
            self.captureException(*sys.exc_info())
Example #2
0
    def get(self, *args, **kwargs):
        try:
            merchant_id = self.get_current_user().get('Fmerchant_id')
            series_service = WeddingCompanySeriesService(self.db)
            series = series_service.query_series(merchant_id=merchant_id)

            self.echo('crm/weddingcompany/series_list.html',
                      {'series': series})
        except Exception, e:
            self.captureException(*sys.exc_info())
Example #3
0
    def get(self, series_id):
        try:
            series_service = WeddingCompanySeriesService(self.db)

            series = series_service.query_series(series_id=series_id).scalar()
            images = series_service.query_series_images(
                series_id=series_id).all()
            self.echo('crm/weddingcompany/series_edit.html', {
                'series': series,
                'images': images
            })

            self.write(ujson.dumps({'stat': 'ok', 'info': '提交成功'}))

        except Exception, e:
            self.write(
                ujson.dumps({
                    'stat': 'error',
                    'info': '错误:' + e.message
                }))
            self.captureException(*sys.exc_info())