def save_server_log(server_id, is_add, request, source, target): the_user_id = UserStateManager.get_the_user_id(request) ip = OperateLogManager.get_request_ipAddress(request) request_path = '/server/save/%s' % server_id if not is_add: save_modify_server_log(source, target, the_user_id, ip, request_path) else: OperateLogManager.save_operate_log(the_user_id, '新建服务器', request_path, ip)
def save_server_modify_log(request, log_param, server_id): msg_str = u'没有操作' msg = [] for key in log_param: msg.append(key) if msg.__len__() != 0: msg_str = ','.join(msg) the_user_id = UserStateManager.get_the_user_id(request) ip = OperateLogManager.get_request_ipAddress(request) request_path = '/game/server/info/%s' % server_id OperateLogManager.save_operate_log(the_user_id, msg_str, request_path, ip)
def pay_fix(request): pay_id = int(request.POST.get('pay_id', '0')) order_id = request.POST.get('order_id', '0') pay_amount = float(request.POST.get('pay_amount', '0')) if pay_id == 0 or order_id == 0 or pay_amount == 0: return HttpResponse(-1) rate = 10 pay_entity = PayAction.objects.using('write').get(id=pay_id) if PayChannel.objects.using('read').filter( id=pay_entity.pay_type).count() != 0: pay_channel_entity = PayChannel.objects.using('read').get( id=pay_entity.pay_type) rate = pay_channel_entity.exchange_rate #***********写日志 ********* the_user_id = UserStateManager.get_the_user_id(request) OperateLogManager.save_operate_log( the_user_id, u'人工补单ID:%d 渠道订单%s' % (pay_id, order_id), '/pay/retroactively', OperateLogManager.get_request_ipAddress(request)) #***********写日志 END ********** pay_gold = pay_amount * rate pay_entity.post_time = datetime.datetime.now() pay_entity.order_id = order_id pay_entity.pay_amount = pay_amount pay_entity.pay_gold = pay_gold pay_entity.pay_status = 2 pay_entity.remark = u'人工补单 %s' % pay_entity.remark if pay_entity.query_id == '': pay_entity.query_id = pay_entity.get_query_id() pay_entity.save(using='write') entity = {} entity['id'] = pay_entity.id entity['order_id'] = pay_entity.order_id entity['pay_amount'] = pay_entity.pay_amount entity['pay_gold'] = pay_entity.pay_gold entity['pay_status'] = pay_entity.pay_status entity['remark'] = pay_entity.remark return HttpResponse(json.dumps(entity))
def save_group_modify_log(request, source, target, is_updateServerList, post_server_list, source_server_list): admin_id = UserStateManager.get_the_user_id(request) msg = [] msg_str = u"没有操作" if source.key != target.key: msg.append('key') if source.name != target.name: msg.append('name') if source.custom_url != target.custom_url: msg.append('custom_url') if source.pay_url != target.pay_url: msg.append('pay_url') if source.upgrade_url != target.upgrade_url: msg.append('upgrade_url') if source.notice_url != target.notice_url: msg.append('notice_url') if int(source.notice_select) != int(target.notice_select): msg.append('notice_select') if source.remark != target.remark: msg.append('remark') if is_updateServerList: msg.append(u'server(') tmp_list = [] for item in source_server_list: tmp_list.append(str(item['id'])) msg.append(','.join(tmp_list)) msg.append(':') msg.append(','.join(post_server_list)) msg.append(')') if msg.__len__() != 0: msg_str = ','.join(msg) request_path = 'group/save/%s' % source.id OperateLogManager.save_operate_log( admin_id, msg_str, request_path, OperateLogManager.get_request_ipAddress(request))