Exemplo n.º 1
0
    def GET(self):
        if logged():
            render = create_render()

            result = 0

            if logged(helper.PRIV_USER | helper.PRIV_MCH):
                # 提醒改密码
                db_user = db.user.find_one({'uname': session.uname},
                                           {'pwd_update': 1})
                if int(time.time()) - db_user.get('pwd_update',
                                                  0) > 3600 * 24 * 30:
                    raise web.seeother('/settings_user?set_pwd=1')
                else:
                    return render.portal(session.uname, get_privilege_name(),
                                         [result])
            else:
                return render.portal(session.uname, get_privilege_name(),
                                     [result])
        else:
            render = create_render()

            db_sys = db.user.find_one({'uname': 'settings'})
            if db_sys == None:
                signup = 0
            else:
                signup = db_sys['signup']

            # 生成验证码
            rand = app_helper.my_rand(4).upper()
            session.uid = rand  # uid 临时存放验证码
            session.menu_level = 0  # 暂存输入验证码次数
            png2 = rand_code.gen_rand_png(rand)

            return render.login(signup, png2)
Exemplo n.º 2
0
    def GET(self):
        if logged():
            render = create_render()
            return render.portal(session.uname, get_privilege_name())
        else:
            render = create_render()

            db_sys = db.user.find_one({'uname': 'settings'})
            if db_sys == None:
                signup = 0
            else:
                signup = db_sys['signup']
            return render.login(signup)
Exemplo n.º 3
0
    def GET(self):
        if logged(helper.PRIV_ADMIN):
            render = create_render()
            user_data = web.input(uid='')

            if user_data.uid == '':
                return render.info('错误的参数!')

            db_user = db.user.find_one({'_id': ObjectId(user_data.uid)})
            if db_user != None:
                db_shop = db.base_shop.find(
                    {
                        'available': 1,
                        'type': {
                            '$in': ['chain', 'store', 'dark']
                        }
                    }, {
                        'name': 1,
                        'type': 1
                    })
                shops = []
                for s in db_shop:
                    shops.append(
                        (s['_id'], s['name'], helper.SHOP_TYPE[s['type']]))
                return render.user_setting(
                    session.uname, user_level[session.privilege], db_user,
                    time_str(db_user['time']),
                    get_privilege_name(db_user['privilege'],
                                       db_user['menu_level']), shops)
            else:
                return render.info('错误的参数!')
        else:
            raise web.seeother('/')
Exemplo n.º 4
0
    def POST(self):
        if helper.logged(helper.PRIV_USER, 'PLAT_BASE_SHOP'):
            render = helper.create_render()
            user_data = web.input()

            for d in user_data.keys():
                if d[:4] == 'poly' and len(user_data[d]) > 0:
                    print d, user_data[d]
                    poly = user_data[d].encode('utf-8').split(';')  # 已经是百度坐标
                    poly_xy = []
                    if len(poly) > 1:
                        for i in poly:
                            poly_xy.append(eval(i))
                        poly_xy.append(poly_xy[0])

                    db.base_shop.update_one(
                        {'_id': ObjectId(d[5:])},
                        {'$set': {
                            'poly': user_data[d],
                            'poly_xy': poly_xy,
                        }})

            return render.info('保存成功!', '/plat/base_shop')
        else:
            raise web.seeother('/')
Exemplo n.º 5
0
    def GET(self):
        import os

        if not logged(helper.PRIV_ADMIN):
            raise web.seeother('/')

        render = create_render()

        uptime = os.popen('uptime').readlines()
        takit = os.popen('pgrep -f "uwsgi_fair.sock"').readlines()
        error_log = os.popen('tail %s/error.log' %
                             setting.logs_path).readlines()
        uwsgi_log = os.popen('tail %s/uwsgi_fair.log' %
                             setting.logs_path).readlines()
        processor_log = os.popen('tail %s/processor.log' %
                                 setting.logs_path).readlines()
        df_data = os.popen('df -h').readlines()

        #import sms_mwkj
        #balance = sms_mwkj.query_balance()

        return render.status(
            session.uname, user_level[session.privilege], {
                'uptime': uptime,
                'takit': takit,
                'error_log': error_log,
                'uwsgi_log': uwsgi_log,
                'process_log': processor_log,
                'df_data': df_data
            })
Exemplo n.º 6
0
    def GET(self):
        if not logged(helper.PRIV_ADMIN):
            raise web.seeother('/')

        render = create_render()
        user_data = web.input(uid='')

        r3 = db.merchant.find({'available': 1})

        db_user = {
            '_id': 'n/a',
            'menu_level': 60 * '-',
            'time': int(time.time())
        }

        if user_data.uid != '':
            r2 = db.user.find_one({'_id': ObjectId(user_data.uid)})
            if r2:
                db_user = r2

        if db_user['_id'] == 'n/a':
            user_level_name = []
        else:
            user_level_name = get_privilege_name(db_user['privilege'],
                                                 db_user['menu_level'])
        return render.user_setting(session.uname,
                                   user_level[session.privilege], db_user,
                                   time_str(db_user['time']), user_level_name,
                                   r3)
Exemplo n.º 7
0
    def GET(self):
        if not helper.logged(helper.PRIV_MCH, 'TOPIC_STORE'):
            raise web.seeother('/')

        mch_id = helper.get_session_mch_id()
        render = helper.create_render()
        user_data = web.input(tpc_id='')

        obj_data = {'tpc_id': 'n/a'}
        obj_list = []

        if user_data.tpc_id != '':
            db_obj = db.topic_store.find_one({
                'tpc_id': user_data.tpc_id,
                'mch_id': mch_id
            })
            if db_obj is not None:
                # 已存在的obj
                obj_data = db_obj
                obj_list = db.obj_store.find({
                    'obj_type': 'topic',
                    'tpc_id': user_data.tpc_id
                })

        return render.topic_store_edit(helper.get_session_uname(),
                                       helper.get_privilege_name(), obj_data,
                                       obj_list)
Exemplo n.º 8
0
    def GET(self):
        if not helper.logged(helper.PRIV_MCH, 'OBJ_STORE'):
            raise web.seeother('/')

        mch_id = helper.get_session_mch_id()
        render = helper.create_render()
        user_data = web.input(obj_id='', exam_id='')

        if user_data.obj_id.strip() == '':
            return render.info('obj_id不能为空!')

        exam_data = {'exam_id': 'n/a'}

        if user_data.exam_id != '':
            db_exam = db.exam_info.find_one({
                'exam_id': user_data.exam_id,
                'mch_id': mch_id
            })
            if db_exam != None:
                # 已存在的obj
                exam_data = db_exam

        return render.exam_edit(helper.get_session_uname(),
                                helper.get_privilege_name(), exam_data,
                                user_data.obj_id)
Exemplo n.º 9
0
    def POST(self):
        if not helper.logged(helper.PRIV_USER, 'CHECK_OBJ'):
            raise web.seeother('/')
        render = helper.create_render()
        user_data = web.input(obj_id='', status='')

        if user_data.obj_id == '':
            return render.info('参数错误!')

        if user_data.status == '':
            return render.info('请选择审核结果!')

        obj_id = user_data['obj_id']

        update_set = {
            'check_comment': user_data['check_comment'],
            'status': user_data['status'],
        }

        message = '审核通过' if user_data['status'] == 'PASSED' else '审核被拒绝'

        object_helper.obj_change_status(obj_id, user_data['status'], message,
                                        user_data['check_comment'])

        return render.info('成功保存!', '/plat/check_obj')
Exemplo n.º 10
0
    def GET(self):
        if not helper.logged(helper.PRIV_USER, 'CHECK_OBJ'):
            raise web.seeother('/')
        user_data=web.input(page='0')
        render = helper.create_render()

        if not user_data['page'].isdigit():
            return render.info('参数错误!')  

        db_sku = db.obj_store.find({'obj_type':'course','status':{'$in':['WAIT', 'PASSED', 'DENY']}},  # 只显示精品课程
            sort=[('obj_id', -1)],
            limit=PAGE_SIZE,
            skip=int(user_data['page'])*PAGE_SIZE
        )

        sku_data = []
        for x in db_sku:
            one = {
                'obj_id'   : x['obj_id'],
                'obj_name' : x['obj_name'],
                'title'    : x['title'],
                'price'    : x['price'],
                'note'     : x['note'],
                'status'   : x.get('status','SAVED'),
            }
            sku_data.append(one)

        num = db_sku.count()
        if num%PAGE_SIZE>0:
            num = num / PAGE_SIZE + 1
        else:
            num = num / PAGE_SIZE
        
        return render.check_obj(helper.get_session_uname(), helper.get_privilege_name(), sku_data,
            range(0, num), helper.OBJ_STATUS)
Exemplo n.º 11
0
    def GET(self):
        if logged(helper.PRIV_ADMIN):
            render = create_render()

            users = []
            db_user = db.user.find({
                'privilege': {
                    '$nin': [helper.PRIV_ADMIN]
                }
            }, {
                'uname': 1,
                'privilege': 1,
                'full_name': 1,
                'login': 1
            }).sort([('_id', 1)])
            if db_user.count() > 0:
                for u in db_user:
                    if u['uname'] == 'settings':
                        continue
                    users.append([
                        u['uname'], u['_id'],
                        int(u['privilege']), u['full_name'], u['login']
                    ])
            return render.user(session.uname, user_level[session.privilege],
                               users)
        else:
            raise web.seeother('/')
Exemplo n.º 12
0
 def GET(self):
     if helper.logged(helper.PRIV_USER, 'PLAT_BASE_SKU'):
         render = helper.create_render()
         return render.base_sku_new(helper.get_session_uname(),
                                    helper.get_privilege_name())
     else:
         raise web.seeother('/')
Exemplo n.º 13
0
 def GET(self):
     if helper.logged(helper.PRIV_USER, 'CRM'):
         render = helper.create_render()
         return render.crm(helper.get_session_uname(),
                           helper.get_privilege_name())
     else:
         raise web.seeother('/')
Exemplo n.º 14
0
    def POST(self):
        if not helper.logged(helper.PRIV_MCH, 'OBJ_STORE'):
            raise web.seeother('/')
        mch_id = helper.get_session_mch_id()
        render = helper.create_render()
        user_data = web.input(obj_id='', tpc_id='')

        if user_data.obj_id == '' and user_data.tpc_id == '':
            return render.info('参数错误!')

        if user_data.obj_id != '':  # 课程
            db_obj = db.obj_store.find_one({
                'obj_id': user_data.obj_id,
                'mch_id': mch_id
            })
            if db_obj is None:
                return render.info('obj_id参数错误!')

            object_helper.obj_change_status(user_data['obj_id'], 'WAIT',
                                            '提交审核')

            return render.info('成功提交!', '/mch/obj_store')

        else:  # 专辑
            db_obj = db.topic_store.find_one({
                'tpc_id': user_data.tpc_id,
                'mch_id': mch_id
            })
            if db_obj is None:
                return render.info('tpc_id参数错误!')

            object_helper.topic_change_status(user_data['tpc_id'], 'WAIT',
                                              '提交审核')

            return render.info('成功提交!', '/mch/topic_store')
Exemplo n.º 15
0
    def GET(self):
        if not helper.logged(helper.PRIV_USER, 'CATEGORY'):
            raise web.seeother('/')

        render = helper.create_render()
        user_data = web.input()

        # 专辑上架商品
        r2 = db.online_topic_obj.find(sort=[('sort_weight', 1)])
        online_obj = [i['tpc_id'] for i in r2]

        # 可上架的专辑
        all_obj = {}
        r3 = db.topic_store.find({'status': 'PASSED'})
        for i in r3:
            all_obj[i['tpc_id']] = {
                'tpc_name': i['tpc_name'],
                'mch_id': i['mch_id'],
                'tpc_id': i['tpc_id']
            }

        # 所有商家
        all_mch = {}
        r4 = db.merchant.find({'available': 1})
        for i in r4:
            all_mch[i['mch_id']] = i['mch_name']

        return render.topic_plat_edit(helper.get_session_uname(),
                                      helper.get_privilege_name(), online_obj,
                                      all_obj, all_mch)
Exemplo n.º 16
0
    def GET(self):
        if not helper.logged(helper.PRIV_USER, 'CHECK_EMPLOYER'):
            raise web.seeother('/')
        user_data = web.input(userid='', action='')
        render = helper.create_render()

        action = user_data['action'].upper()
        if action not in ['PASS', 'NOGO', 'WAIT']:
            return render.info('action参数错误!')

        r2 = db.app_user.find_one({'userid': user_data['userid'], 'type': 1})
        if r2 is None:
            return render.info('userid错误!')

        update_set = {}
        if action == 'PASS':
            update_set['user_role'] = 2
            update_set['user_role_status'] = 'PASS'
        elif action == 'NOGO':
            update_set['user_role'] = 0
            update_set['user_role_status'] = 'NOGO'
        else:
            update_set['user_role'] = 3
            update_set['user_role_status'] = 'WAIT'

        db.app_user.update_one({
            'userid': user_data['userid'],
            'type': 1
        }, {'$set': update_set})

        return render.info('成功保存!', '/plat/check_employer')
Exemplo n.º 17
0
    def POST(self):
        if not helper.logged(helper.PRIV_USER, 'CATEGORY'):
            raise web.seeother('/')
        render = helper.create_render()
        user_data = web.input(online_list='')

        if len(user_data.online_list.strip()) > 0:
            online_list = user_data.online_list.split(',')
        else:
            online_list = []

        print online_list

        # 记录类目商品上架信息
        db.online_topic_obj.remove({})
        for i, tpc_id in enumerate(online_list):
            r3 = db.topic_store.find_one({'tpc_id': tpc_id}, {'status': 1})
            available = (1 if r3['status'] == 'PASSED' else 0) if r3 else 0
            db.online_topic_obj.update_one(
                {'tpc_id': tpc_id},
                {'$set': {
                    'available': available,
                    'sort_weight': i
                }},
                upsert=True)

        return render.info('成功保存!', '/plat/topic_edit')
Exemplo n.º 18
0
	def POST(self):
		if helper.logged(helper.PRIV_USER,'APP_PUSH'):
			render = helper.create_render()
			user_data=web.input(phone='',content='')

			if user_data.phone.strip()=='': # 发送全部
				r=jpush.jpush(user_data.content)
				#r = False # 测试时关闭全部发送
			else:
				# 发送指定号码,最多1000个号码
				r=jpush.jpush(user_data.content, user_data.phone)

			# 记录发送日志
			db.jpush_log.insert({ 
				'push_time' : helper.time_str(),
				'user'      : helper.get_session_uname(),
				'phone'     : user_data.phone.strip(),
				'content'   : user_data.content,
				'result'    : r
			})

			if r!=False:
				return render.info('发送成功! '+r,'/plat/push_msg')
			else:
				return render.info('发送失败!','/plat/push_msg')
		else:
		    raise web.seeother('/')
Exemplo n.º 19
0
    def GET(self):
        if helper.logged(helper.PRIV_USER, 'REPORT_VOICE'):
            render = helper.create_render()
            #user_data=web.input(start_date='', shop='__ALL__', ret_type='table')

            # 显示最近30天的
            start_date = helper.time_str(time.time() - 3600 * 24 * 30,
                                         format=1)

            # 起至时间
            begin_date = '%s 00:00:00' % start_date
            #end_date = '%s 23:59:59' % start_date

            #print begin_date, end_date

            #
            db_voice = db.customer_voice.find({
                'time': {
                    '$gt': begin_date
                }
            }, {
                '_id': 0
            }).sort([('_id', -1)])

            return render.report_voice(helper.get_session_uname(),
                                       helper.get_privilege_name(), db_voice)
        else:
            raise web.seeother('/')
Exemplo n.º 20
0
 def GET(self):
     if helper.logged(helper.PRIV_USER, 'REPORT_QUERY'):
         render = helper.create_render()
         return render.report_query(helper.get_session_uname(),
                                    helper.get_privilege_name())
     else:
         raise web.seeother('/')
Exemplo n.º 21
0
	def GET(self):
		if helper.logged(helper.PRIV_USER,'PLAT_SKU_STORE'):
			render = helper.create_render()

			skus=[]         
			db_sku=db.sku_store.find({},{
				'product_id' : 1,
				'base_sku'   : 1,
				'note'       : 1,
				'available'  : 1,
				'is_pack'    : 1,
				'unit'       : 1,
				#'unit_num'   : 1,
				'ref_price'  : 1,
				'ref_cost'   : 1,
				'list_in_app': 1,
				'app_title'  : 1,
			}).sort([('_id',1)])
			
			for u in db_sku:
				base_sku = db.dereference(u['base_sku'])

				# 准备数据
				skus.append((u['_id'], 
					base_sku['name'] if len(u['app_title'].strip())==0 else u['app_title'], 
					u['note'], u['available'],
					base_sku['image'][0] if base_sku.has_key('image') and len(base_sku['image'])>0 else '',
					'', helper.UNIT_TYPE[u['unit']], 
					u['is_pack'], u['ref_price'], u['product_id'], u['ref_cost'],
					u['list_in_app']
				))
			return render.sku_store(helper.get_session_uname(), helper.get_privilege_name(), skus)
		else:
		    raise web.seeother('/')
Exemplo n.º 22
0
	def GET(self):
		if helper.logged(helper.PRIV_USER,'PLAT_PT_STORE'):
			render = helper.create_render()
			return render.pt_store_new(helper.get_session_uname(), helper.get_privilege_name(),
				helper.PT_REGION)
		else:
			raise web.seeother('/')
Exemplo n.º 23
0
    def POST(self):
        if not logged(helper.PRIV_ADMIN):
            raise web.seeother('/')

        render = create_render()
        old_pwd = web.input().old_pwd.strip()
        new_pwd = web.input().new_pwd.strip()
        new_pwd2 = web.input().new_pwd2.strip()

        if old_pwd != '':
            if new_pwd == '':
                return render.info('新密码不能为空!请重新设置。')
            if new_pwd != new_pwd2:
                return render.info('两次输入的新密码不一致!请重新设置。')
            db_user = db.user.find_one({'_id': session.uid}, {'passwd': 1})
            if app_helper.my_crypt(old_pwd) == db_user['passwd']:
                db.user.update_one(
                    {'_id': session.uid},
                    {'$set': {
                        'passwd': app_helper.my_crypt(new_pwd)
                    }})
                return render.info('成功保存!', '/')
            else:
                return render.info('登录密码验证失败!请重新设置。')
        else:
            return render.info('未做任何修改。')
Exemplo n.º 24
0
    def GET(self):
        if helper.logged(helper.PRIV_USER, 'STOCK_INVENTORY'):
            render = helper.create_render()
            user_data = web.input(sku='')

            if user_data.sku == '':
                return render.info('错误的参数!')

            db_sku = db.sku_store.find_one({'_id': ObjectId(user_data.sku)})
            if db_sku != None:
                db_shop = db.base_shop.find({'available': 1}, {
                    'name': 1,
                    'type': 1
                })
                shops = []
                for s in db_shop:
                    shops.append(
                        (s['_id'], s['name'], helper.SHOP_TYPE[s['type']]))
                base_sku = db.dereference(db_sku['base_sku'])
                return render.stock_invent_edit(
                    helper.get_session_uname(), helper.get_privilege_name(),
                    db_sku, {
                        'name': base_sku['name'],
                        'original': base_sku['original']
                    }, helper.UNIT_TYPE, shops)
            else:
                return render.info('错误的参数!')
        else:
            raise web.seeother('/')
Exemplo n.º 25
0
    def GET(self):
        if not logged(helper.PRIV_ADMIN):
            raise web.seeother('/')

        render = create_render()

        db_active = db.user.find(
            {
                '$and': [
                    {
                        'login': 1
                    },
                    {
                        'privilege': helper.PRIV_USER
                    },
                ]
            }, {
                '_id': 1
            }).count()
        db_nonactive = db.user.find(
            {
                '$and': [
                    {
                        'login': 0
                    },
                    {
                        'privilege': helper.PRIV_USER
                    },
                ]
            }, {
                '_id': 1
            }).count()
        db_admin = db.user.find({
            'privilege': helper.PRIV_ADMIN
        }, {
            '_id': 1
        }).count()

        db_sessions = db.sessions.find({}, {'_id': 1}).count()
        db_device = db.device.find({}, {'_id': 1}).count()
        db_todo = db.todo.find({}, {'_id': 1}).count()
        db_sleep = db.todo.find({'status': 'SLEEP'}, {'_id': 1}).count()
        db_lock = db.todo.find({'lock': 1}, {'_id': 1}).count()
        db_thread = db.thread.find({}).sort([('tname', 1)])
        idle_time = []
        for t in db_thread:
            idle_time.append(t)

        return render.data(
            session.uname, user_level[session.privilege], {
                'active': db_active,
                'nonactive': db_nonactive,
                'admin': db_admin,
                'sessions': db_sessions,
                'device': db_device,
                'todo': db_todo,
                'sleep': db_sleep,
                'lock': db_lock,
                'idle_time': idle_time,
            })
Exemplo n.º 26
0
    def GET(self):
        if helper.logged(helper.PRIV_USER):
            render = helper.create_render()
            user_data = web.input(sku='')

            if user_data.sku == '':
                return render.info('错误的参数!')

            # 检查用户是否有此店权限
            db_shop = helper.get_shop_by_uid()

            # 查找店面信息
            db_shop2 = helper.get_shop(db_shop['shop'])
            if db_shop2 == None:
                return render.info('未找到所属门店!')

            db_sku = db.sku_store.find_one({'_id': ObjectId(user_data.sku)})
            if db_sku != None:
                base_sku = db.dereference(db_sku['base_sku'])
                return render.damage_sku(
                    helper.get_session_uname(), helper.get_privilege_name(),
                    db_sku, {
                        'name': base_sku['name'],
                        'original': base_sku['original']
                    }, helper.UNIT_TYPE,
                    (str(db_shop2['_id']), db_shop2['name'],
                     helper.SHOP_TYPE[db_shop2['type']]),
                    helper.get_inventory(ObjectId(user_data.sku),
                                         db_shop['shop']))
            else:
                return render.info('错误的参数!')
        else:
            raise web.seeother('/')
Exemplo n.º 27
0
    def GET(self):
        if helper.logged(helper.PRIV_USER, 'PLAT_BASE_SHOP'):
            render = helper.create_render(plain=True)

            db_shop = db.base_shop.find(
                {
                    'type': {
                        '$in': ['chain', 'store', 'dark', 'counter']
                    }
                }, {
                    'name': 1,
                    'type': 1,
                    'poly': 1,
                    'poly_xy': 1,
                    'app_shop': 1,
                }).sort([('_id', 1)])

            data = []
            for i in db_shop:
                data.append({
                    'id': i['_id'],
                    'name': i['name'],
                    'poly': i.get('poly', ''),
                    'poly_xy': i.get('poly_xy', []),
                    'app_shop': i.get('app_shop', 0)
                })
            return render.map_shops(helper.get_session_uname(),
                                    helper.get_privilege_name(), data)
        else:
            raise web.seeother('/')
Exemplo n.º 28
0
    def GET(self):
        if helper.logged(helper.PRIV_USER, 'PLAT_BASE_SKU'):
            render = helper.create_render()

            skus = []
            db_sku = db.base_sku.find({}, {
                'name': 1,
                'note': 1,
                'available': 1,
                'image': 1,
                'original': 1,
            }).sort([('_id', 1)])
            for u in db_sku:
                skus.append((
                    u['_id'],
                    u['name'],
                    u['note'],
                    u['available'],
                    u['image'][0]
                    if u.has_key('image') and len(u['image']) > 0 else '',
                    u['original'],
                ))
            return render.base_sku(helper.get_session_uname(),
                                   helper.get_privilege_name(), skus)
        else:
            raise web.seeother('/')
Exemplo n.º 29
0
    def GET(self):
        if not helper.logged(helper.PRIV_USER, 'DOCTOR_USE'):
            raise web.seeother('/')
        user_data = web.input(page='0')
        render = helper.create_render()

        if not user_data['page'].isdigit():
            return render.info('参数错误!')

        # 分页获取数据
        db_sku = db.pages.find({
            'first_page': 1,
            'available': 1
        },
                               sort=[('page_code', 1)],
                               limit=PAGE_SIZE,
                               skip=int(user_data['page']) * PAGE_SIZE)

        num = db_sku.count()
        if num % PAGE_SIZE > 0:
            num = num / PAGE_SIZE + 1
        else:
            num = num / PAGE_SIZE

        return render.diagnose(helper.get_session_uname(),
                               helper.get_privilege_name(), db_sku,
                               range(0, num))
Exemplo n.º 30
0
    def POST(self):
        import re
        if logged(helper.PRIV_USER, 'CRM'):
            render = create_render()
            user_data = web.input(cat='', content='')

            if user_data.cat == '' or user_data.content == '':
                return render.info('错误的参数!')

            condi = {
                user_data.cat: {
                    '$in': [
                        re.compile('^.*%s.*' %
                                   user_data.content.strip().encode('utf-8'))
                    ]
                },
                #'status':{'$nin':['TIMEOUT']}
            }
            db_todo = db.order_app.find(condi, {
                'order_id': 1,
                'uname': 1,
                'paid_time': 1,
                'status': 1
            }).sort([('b_time', -1)])
            if db_todo.count() > 0:
                return render.report_order(session.uname, get_privilege_name(),
                                           db_todo, helper.ORDER_STATUS)
            else:
                return render.info('未查到订单信息。')
        else:
            raise web.seeother('/')