Exemplo n.º 1
0
	def get_game_list(self,uid):
		game_list = self.gamemodel.get_game_list()
		for game_info in game_list:
			game_info['gacceptstartdate'] = PublicFunc.stamp_to_Ymd(game_info['gacceptstart'])
			game_info['gacceptenddate'] = PublicFunc.stamp_to_Ymd(game_info['gacceptend'])
			game_info['gfrontpage'] = options.ipnet + game_info['gfrontpage']
			game_info['agreement'] = options.ipnet + '/py/game?action=get_agreement&id=' + str(game_info['gid'])
			game_info['gstatusid'],game_info['gstatus'] = self.get_status_name(game_info['gstarttime'],game_info['gendtime'],game_info['gacceptstart'],game_info['gacceptend'])
			if game_info['gid'] == 7:
				game_info['gintro'] = options.ipnet + '/bjjbz/intro.html?uid=' + str(uid)
				game_info['gintro_wecha'] = options.ipnet + '/bjjbz/intro.html?uid=' + str(uid)
			elif game_info['gid'] == 9:
				# game_info['gintro'] = 'http://mp.weixin.qq.com/s?__biz=MzI4MzM4MDM5MQ==&tempkey=6TdVDeLTjka%2FMedRgXr1jw5%2FEhRKAIdReyd2gYGoWvwCSJzZcVIQlw8ahYcN%2BhuSTga1LrgOwZ4xABg1O%2BbrtOuAdiWuSbVezSlYfihfUS3PSw1YoiJG8DhKWPiejoTWzHRVFZZrRPYejqkYKPGd1A%3D%3D&scene=1&srcid=0725qMCq5oIglvAmfbrXsUvp#wechat_redirect'
				# game_info['gintro_wecha'] = 'http://mp.weixin.qq.com/s?__biz=MzI4MzM4MDM5MQ==&tempkey=6TdVDeLTjka%2FMedRgXr1jw5%2FEhRKAIdReyd2gYGoWvwCSJzZcVIQlw8ahYcN%2BhuSTga1LrgOwZ4xABg1O%2BbrtOuAdiWuSbVezSlYfihfUS3PSw1YoiJG8DhKWPiejoTWzHRVFZZrRPYejqkYKPGd1A%3D%3D&scene=1&srcid=0725qMCq5oIglvAmfbrXsUvp#wechat_redirect'
				game_info['gintro'] = 'http://mp.weixin.qq.com/s?__biz=MzI4MzM4MDM5MQ==&mid=2247483830&idx=1&sn=a5e8ba2a262f3a1da7b65a5c18037315&scene=1&srcid=0725YTSd96e9sFKnqkH9AQZt#rd'
				game_info['gintro_wecha'] = 'http://mp.weixin.qq.com/s?__biz=MzI4MzM4MDM5MQ==&mid=2247483830&idx=1&sn=a5e8ba2a262f3a1da7b65a5c18037315&scene=1&srcid=0725YTSd96e9sFKnqkH9AQZt#rd'
			elif game_info['gid'] == 10:
				game_info['gintro'] = 'http://mp.weixin.qq.com/s?__biz=MzI4MzM4MDM5MQ==&mid=2247483874&idx=1&sn=6371b0fd66106ce4e21650eb82b88090&scene=23&srcid=0729PXR5Q6FQFYiWnTr1vICx#rd'
				game_info['gintro_wecha'] = 'http://mp.weixin.qq.com/s?__biz=MzI4MzM4MDM5MQ==&mid=2247483874&idx=1&sn=6371b0fd66106ce4e21650eb82b88090&scene=23&srcid=0729PXR5Q6FQFYiWnTr1vICx#rd'
			elif game_info['gid'] == 12:
				game_info['gintro'] = "http://mp.weixin.qq.com/s?__biz=MzI4MzM4MDM5MQ==&mid=2247483877&idx=1&sn=2efec6568c5cf9b434d43e96b76d9b00#rd"
				game_info['gintro_wecha'] = "http://mp.weixin.qq.com/s?__biz=MzI4MzM4MDM5MQ==&mid=2247483877&idx=1&sn=2efec6568c5cf9b434d43e96b76d9b00#rd"
			else:
				game_info['gintro'] = options.ipnet + '/py/game?action=get_intro&id=' + str(game_info['gid']) + \
            	'&uid=' + str(uid) + '&gtype=' + str(game_info['gtype_id'])
            	game_info['gintro_wecha'] = options.ipnet + '/ky/game?action=get_intro&id=' + str(game_info['gid']) + \
            	'&uid=' + str(uid) + '&gtype=' + str(game_info['gtype_id'])
        	del game_info['gacceptstart']
        	del game_info['gacceptend']
		return game_list
Exemplo n.º 2
0
 def get_game_list(self, uid):
     game_list = self.gamemodel.get_game_list()
     for game_info in game_list:
         game_info['gacceptstartdate'] = PublicFunc.stamp_to_Ymd(
             game_info['gacceptstart'])
         game_info['gacceptenddate'] = PublicFunc.stamp_to_Ymd(
             game_info['gacceptend'])
         game_info['gfrontpage'] = options.ipnet + game_info['gfrontpage']
         game_info[
             'agreement'] = options.ipnet + '/py/game?action=get_agreement&id=' + str(
                 game_info['gid'])
         game_info['gstatusid'], game_info[
             'gstatus'] = self.get_status_name(game_info['gstarttime'],
                                               game_info['gendtime'],
                                               game_info['gacceptstart'],
                                               game_info['gacceptend'])
         if game_info['gid'] == 7:
             game_info[
                 'gintro'] = options.ipnet + '/bjjbz/intro.html?uid=' + str(
                     uid)
             game_info[
                 'gintro_wecha'] = options.ipnet + '/bjjbz/intro.html?uid=' + str(
                     uid)
         elif game_info['gid'] == 9:
             # game_info['gintro'] = 'http://mp.weixin.qq.com/s?__biz=MzI4MzM4MDM5MQ==&tempkey=6TdVDeLTjka%2FMedRgXr1jw5%2FEhRKAIdReyd2gYGoWvwCSJzZcVIQlw8ahYcN%2BhuSTga1LrgOwZ4xABg1O%2BbrtOuAdiWuSbVezSlYfihfUS3PSw1YoiJG8DhKWPiejoTWzHRVFZZrRPYejqkYKPGd1A%3D%3D&scene=1&srcid=0725qMCq5oIglvAmfbrXsUvp#wechat_redirect'
             # game_info['gintro_wecha'] = 'http://mp.weixin.qq.com/s?__biz=MzI4MzM4MDM5MQ==&tempkey=6TdVDeLTjka%2FMedRgXr1jw5%2FEhRKAIdReyd2gYGoWvwCSJzZcVIQlw8ahYcN%2BhuSTga1LrgOwZ4xABg1O%2BbrtOuAdiWuSbVezSlYfihfUS3PSw1YoiJG8DhKWPiejoTWzHRVFZZrRPYejqkYKPGd1A%3D%3D&scene=1&srcid=0725qMCq5oIglvAmfbrXsUvp#wechat_redirect'
             game_info[
                 'gintro'] = 'http://mp.weixin.qq.com/s?__biz=MzI4MzM4MDM5MQ==&mid=2247483830&idx=1&sn=a5e8ba2a262f3a1da7b65a5c18037315&scene=1&srcid=0725YTSd96e9sFKnqkH9AQZt#rd'
             game_info[
                 'gintro_wecha'] = 'http://mp.weixin.qq.com/s?__biz=MzI4MzM4MDM5MQ==&mid=2247483830&idx=1&sn=a5e8ba2a262f3a1da7b65a5c18037315&scene=1&srcid=0725YTSd96e9sFKnqkH9AQZt#rd'
         elif game_info['gid'] == 10:
             game_info[
                 'gintro'] = 'http://mp.weixin.qq.com/s?__biz=MzI4MzM4MDM5MQ==&mid=2247483874&idx=1&sn=6371b0fd66106ce4e21650eb82b88090&scene=23&srcid=0729PXR5Q6FQFYiWnTr1vICx#rd'
             game_info[
                 'gintro_wecha'] = 'http://mp.weixin.qq.com/s?__biz=MzI4MzM4MDM5MQ==&mid=2247483874&idx=1&sn=6371b0fd66106ce4e21650eb82b88090&scene=23&srcid=0729PXR5Q6FQFYiWnTr1vICx#rd'
         elif game_info['gid'] == 12:
             game_info[
                 'gintro'] = "http://mp.weixin.qq.com/s?__biz=MzI4MzM4MDM5MQ==&mid=2247483877&idx=1&sn=2efec6568c5cf9b434d43e96b76d9b00#rd"
             game_info[
                 'gintro_wecha'] = "http://mp.weixin.qq.com/s?__biz=MzI4MzM4MDM5MQ==&mid=2247483877&idx=1&sn=2efec6568c5cf9b434d43e96b76d9b00#rd"
         else:
             game_info['gintro'] = options.ipnet + '/py/game?action=get_intro&id=' + str(game_info['gid']) + \
                      '&uid=' + str(uid) + '&gtype=' + str(game_info['gtype_id'])
     game_info['gintro_wecha'] = options.ipnet + '/ky/game?action=get_intro&id=' + str(game_info['gid']) + \
     '&uid=' + str(uid) + '&gtype=' + str(game_info['gtype_id'])
     del game_info['gacceptstart']
     del game_info['gacceptend']
     return game_list
Exemplo n.º 3
0
	def get_user_post(self,uid,page,perpage):
		"""获取用户的朋友圈"""
		post_list = PostModel().get_user_post(uid,page,perpage)
		current_time = PublicFunc.get_current_stamp()
		is_today = 1 # 默认是今天
		for post in post_list:
			post['post_id'] = str(post['_id'])
			del post['_id'] 
			if not PublicFunc.get_date_today() == PublicFunc.stamp_to_Ymd(post['time']):is_today = 0
			post['is_today'] = is_today
			date_info = PublicFunc.get_date_info(post['time'],['day','month'])
			# post['pic_list'] = [{'ori_pic':options.ipnet + pic,'thumb_pic':options.ipnet+options.post_thumb_save_path+'t'+pic[-17:]} for pic in post['pic_list']]
			post['pic_list'] = [{'ori_pic':options.ipnet + pic,'thumb_pic':options.ipnet+pic} for pic in post['pic_list']]
			post['day'] = date_info['day']
			post['month'] = date_info['month']
		return post_list