Commit c4567a8d authored by xupeng's avatar xupeng

Merge remote-tracking branch 'origin/development' into development

# Conflicts:
#	app/api/statement/guild.py
parents 2df043d6 51ae5d21
...@@ -257,18 +257,26 @@ def get_finance_info(unique_tag, page, size, start_time, end_time, is_list=None) ...@@ -257,18 +257,26 @@ def get_finance_info(unique_tag, page, size, start_time, end_time, is_list=None)
return res return res
def get_account_type(db: Session, **data): def get_account_type(**data):
"""礼物类型配置列表""" """礼物类型配置列表"""
finance_filters = [] condition = []
if data.get("key_name"): if data.get("key_name"):
finance_filters.append(AccountType.key_name.like(f'%{data.get("key_name")}%')) condition.append(f" keyName like '%{data.get('key_name')}%'")
if data.get("key_value"): if data.get("key_value"):
finance_filters.append(AccountType.key_value.like(f'%{data.get("key_value")}%')) condition.append(f" keyValue like '%{data.get('key_value')}%'")
if data.get("type") or data.get("type") == 0: if data.get("type") or data.get("type") == 0:
finance_filters.append(AccountType.type == data.get("type")) condition.append(f" type={data.get('type')}")
querydata, count = QueryAllData(db, AccountType, data, finance_filters).query_data() if condition:
data = [QueryAllData.serialization(item) for item in querydata] total_sql = f"select count(id) as num from fi_account_type where {' and '.join(condition)}"
return data, count gift_sql = f"select id,keyName,keyValue,type from fi_account_type where {' and '.join(condition)} limit {(int(data.get('page')) - 1) * data.get('size')},{data.get('size')}"
else:
total_sql = f"select count(id) as num from fi_account_type"
gift_sql = f"select id,keyName,keyValue,type from fi_account_type limit {(int(data.get('page')) - 1) * data.get('size')},{data.get('size')}"
total = LinkMysql(env.DB_3YV2).query_mysql(total_sql)
output = LinkMysql(env.DB_3YV2).query_mysql(gift_sql)
if output:
return output, total[0]['num']
return [], 0
def update_account_type(db: Session, data): def update_account_type(db: Session, data):
......
...@@ -7,6 +7,7 @@ from app.api.account import schemas, crud ...@@ -7,6 +7,7 @@ from app.api.account import schemas, crud
from app.api.account.crud import AccountStatistics, SpecificAccountQuery from app.api.account.crud import AccountStatistics, SpecificAccountQuery
from app.api.statement import crud as statement_crud from app.api.statement import crud as statement_crud
from libs import functions from libs import functions
from libs.functions import get_date_list
from libs.result_format import HttpResultResponse, HttpMessage from libs.result_format import HttpResultResponse, HttpMessage
from libs.token_verify import login_required from libs.token_verify import login_required
...@@ -126,7 +127,7 @@ def finance_fix(page: int, ...@@ -126,7 +127,7 @@ def finance_fix(page: int,
type: int = None, type: int = None,
token=Depends(login_required), db: Session = Depends(get_db)): token=Depends(login_required), db: Session = Depends(get_db)):
"""出入账目配置列表""" """出入账目配置列表"""
res, num = crud.get_account_type(db, key_name=key_name, key_value=key_value, type=type, page=page, size=size) res, num = crud.get_account_type(key_name=key_name, key_value=key_value, type=type, page=page, size=size)
return HttpResultResponse(total=num, data=res) return HttpResultResponse(total=num, data=res)
......
...@@ -150,10 +150,6 @@ def account_thead_task(data): ...@@ -150,10 +150,6 @@ def account_thead_task(data):
account = LinkMysql(env.DB_3YV2).query_mysql(account_sql) account = LinkMysql(env.DB_3YV2).query_mysql(account_sql)
if account: if account:
data['transfer_name'] = account[0]['name'] data['transfer_name'] = account[0]['name']
else:
user_sql = f"select nick_name from v2_user where uuid='{data['transfer_uuid']}' limit 0,1"
user_data = LinkMysql(env.DB_3YV2).query_mysql(user_sql)
data['transfer_name'] = user_data[0]['nick_name'] if user_data else data['transfer_uuid']
def accout_list_data(**params): def accout_list_data(**params):
...@@ -296,7 +292,7 @@ def transfer_trigger_task(uuid, user_id, balance, type, amount_type, remark='用 ...@@ -296,7 +292,7 @@ def transfer_trigger_task(uuid, user_id, balance, type, amount_type, remark='用
status = 3 status = 3
amount_type_id = 1 if amount_type == 'consumable' else 2 amount_type_id = 1 if amount_type == 'consumable' else 2
add_sql = f"insert into all_record_table(user_id, type, status, reference_number, remark, money, is_add, money_data,create_time,amount_type) " \ add_sql = f"insert into all_record_table(user_id, type, status, reference_number, remark, money, is_add, money_data,create_time,amount_type) " \
f"values({user_id}, '{type}', {status},'{get_order()}','{remark}', {balance * 10 if amount_type == 'consumable' else balance * 100},1,'{json.dumps(money_data)}',{get_now_timestamp()},{amount_type_id});" f"values({user_id}, '{type}', {status},'{get_order()}','{remark}', {float(balance) * 10 if amount_type == 'consumable' else float(balance) * 100},1,'{json.dumps(money_data)}',{get_now_timestamp()},{amount_type_id});"
LinkMysql(env.DB_3YV2).perform_mysql(add_sql) LinkMysql(env.DB_3YV2).perform_mysql(add_sql)
return '' return ''
......
...@@ -259,5 +259,5 @@ def menu_list(db: Session = Depends(get_db),menu_type: Optional[int] = ""): ...@@ -259,5 +259,5 @@ def menu_list(db: Session = Depends(get_db),menu_type: Optional[int] = ""):
@router.post("/guild/accounts") @router.post("/guild/accounts")
def guild_add(data: schemas.GuildAddLog, db: Session = Depends(get_db)): def guild_add(data: schemas.GuildAddLog, db: Session = Depends(get_db)):
"""公会结算""" """公会结算"""
code,data=GuildSettlementAdd(db, data) code, data = GuildSettlementAdd(db, data)
return HttpResultResponse(code=code, data=data) return HttpResultResponse(code=code, data=data)
...@@ -3,12 +3,12 @@ from core.config.env import env ...@@ -3,12 +3,12 @@ from core.config.env import env
TYPE_NAME = { TYPE_NAME = {
"updateUserNameFee": "用户昵称修改", "updateUserNameFee": "用户昵称修改",
"updateFamilyNameFee": "家族改名", "updateFamilyNameFee": "家族改名",
"userExchange": "珍珠兑换钻石(用户)", "userExchange": "珍珠兑换钻石",
"userRecharge": "充值", "userRecharge": "充值",
"pay_discount": "充值-折扣", "pay_discount": "充值折扣",
"studioGift": "直播间送礼", "studioGift": "直播间送礼",
"turntableIncome": "转盘", "turntableIncome": "转盘",
"turntableExpend": "转盘-中奖", "turntableExpend": "转盘中奖",
"recyclingGifts": "回收礼物", "recyclingGifts": "回收礼物",
"buyIdentity": "开贵族", "buyIdentity": "开贵族",
"buyGuard": "开守护", "buyGuard": "开守护",
...@@ -16,16 +16,17 @@ TYPE_NAME = { ...@@ -16,16 +16,17 @@ TYPE_NAME = {
"buyProp": "购买道具", "buyProp": "购买道具",
"bei_to_change_account": "购买bei+", "bei_to_change_account": "购买bei+",
"bei_to_cancel_account": "bei+订单退款", "bei_to_cancel_account": "bei+订单退款",
"signInDeductMoney": "补签", "signInDeductMoney": "用户补签",
"signInReward": "钻石奖励", "signInReward": "签到奖励",
"sign_in_backpack_account": "背包礼物奖励", "sign_in_backpack_account": "背包礼物奖励",
"live_support": "主播扶持分配", "live_support": "主播扶持分配",
"room_support": "直播间扶持 - 领取钻石奖励", "room_support": "直播间扶持 - 领取钻石奖励",
"lucky_gift_jackpot": "赠送幸运礼物", "lucky_gift_jackpot": "赠送幸运礼物",
"gameReward": "暴击奖励", "gameReward": "游戏奖励",
"userWithdrawal": "用户提现", "userWithdrawal": "用户提现",
"sendRedBox": "发送红包", "sendRedBox": "发送红包",
"userRedBox": "领红包,退还红包", "userRedBox": "红包领取",
"returnRedBox": "红包退还",
"send_diamond_red_packet": "钻石红包发送", "send_diamond_red_packet": "钻石红包发送",
"get_red_packet": "钻石红包领取", "get_red_packet": "钻石红包领取",
"send_diamond_red_packet_back": "钻石红包退还", "send_diamond_red_packet_back": "钻石红包退还",
...@@ -33,7 +34,7 @@ TYPE_NAME = { ...@@ -33,7 +34,7 @@ TYPE_NAME = {
"get_gift_red_packet": "礼物红包领取", "get_gift_red_packet": "礼物红包领取",
"send_gift_red_packet_back": "礼物红包退还", "send_gift_red_packet_back": "礼物红包退还",
"first_recharge_gift": "首充礼包", "first_recharge_gift": "首充礼包",
"user_clean_up": "用户余额清算(线上,线下)", "user_clean_up": "余额清算(线上,线下)",
"cleargiftstore": "背包礼物过期", "cleargiftstore": "背包礼物过期",
"daily_task": "任务奖励发放钻石", "daily_task": "任务奖励发放钻石",
"voiceChatFee": "语聊消费", "voiceChatFee": "语聊消费",
...@@ -41,9 +42,10 @@ TYPE_NAME = { ...@@ -41,9 +42,10 @@ TYPE_NAME = {
"vip_recharge": "vip购买", "vip_recharge": "vip购买",
"PlatformLeakRepair": "平台补漏", "PlatformLeakRepair": "平台补漏",
"voice": "用户上麦", "voice": "用户上麦",
"MagicHegemony": "2021.11 魔法争霸赛活动", "MagicHegemony": "魔法争霸赛活动",
"Points_mall_exchange": "商城积分兑换", "Points_mall_exchange": "积分商城兑换",
"privateMessageCharge": "私信收费", "privateMessageCharge": "私信收费",
"personalMessageGift": "私信礼物",
"level_gift": "升级礼包", "level_gift": "升级礼包",
"zhou_xing_backpack_account": "周星奖励发放", "zhou_xing_backpack_account": "周星奖励发放",
"zhou_xing_consumable_account": "周星奖励发放", "zhou_xing_consumable_account": "周星奖励发放",
...@@ -53,18 +55,20 @@ TYPE_NAME = { ...@@ -53,18 +55,20 @@ TYPE_NAME = {
"gama:KMH": "参与游戏-开盲盒", "gama:KMH": "参与游戏-开盲盒",
"game_transfer": "商城礼物盲盒-许愿池,八卦象", "game_transfer": "商城礼物盲盒-许愿池,八卦象",
"gama:ZJD": "参与游戏-砸金蛋", "gama:ZJD": "参与游戏-砸金蛋",
"guildExchange": "公会钻石结算", "guildExchange": "公会结算",
"marginRecharge": "保证金缴纳", "marginRecharge": "保证金缴纳",
"pledgeDeduction": "保证金扣减", "pledgeDeduction": "保证金扣减",
"guildExchangeDraw": "公会钻石结算", "guildExchangeDraw": "公会钻石结算",
"fanExpansion": "公会家族扩充", "fanExpansion": "公会家族扩充",
"guildTrafficPromotion": "公会流量推广", "guildTrafficPromotion": "流量推广",
"trafficPromotion": "流量购买",
"guildWithdrawal": "公会提现", "guildWithdrawal": "公会提现",
"guildWithdrawal_ServiceFee": "提现服务费", "guildWithdrawal_ServiceFee": "提现服务费",
"free_guild_profit_Exchange": "自由公会收益", "free_guild_profit_Exchange": "自由公会收益",
"subordinate_guild_ti_xian": "下级公会提现", "subordinate_guild_ti_xian": "下级公会提现",
"investmentIncome": "招商收益", "investmentIncome": "招商收益",
"platformRecharge": "财务后台内部转账", "platformRecharge": "转账",
"platformSubsidies": "平台补贴",
"currencyUpgrade": "旧币兑换(钻石)", "currencyUpgrade": "旧币兑换(钻石)",
"PlatformDeduction": "平台扣除", "PlatformDeduction": "平台扣除",
"thrid_game_transfer_user": "引流转盘奖励", "thrid_game_transfer_user": "引流转盘奖励",
...@@ -116,7 +120,7 @@ TYPE_NAME = { ...@@ -116,7 +120,7 @@ TYPE_NAME = {
"heart_season_award": "怦然心动活动榜单奖励", "heart_season_award": "怦然心动活动榜单奖励",
"OnePieceActivityBuyItem": "航海活动购买道具", "OnePieceActivityBuyItem": "航海活动购买道具",
"challenge": "用户发起挑战功能", "challenge": "用户发起挑战功能",
"AnnualCelebration": "年度(20.12.24-21.1.3)", "AnnualCelebration": "年度活动",
"LaborDayActivityBuyProp": "四季仙踪活动道具购买", "LaborDayActivityBuyProp": "四季仙踪活动道具购买",
"april_fools_2022": "4月活动奖励", "april_fools_2022": "4月活动奖励",
"wzzyn_2022_consume": "端午活动用户购买道具", "wzzyn_2022_consume": "端午活动用户购买道具",
...@@ -127,7 +131,23 @@ TYPE_NAME = { ...@@ -127,7 +131,23 @@ TYPE_NAME = {
"OnePieceActivity": "航海活动奖励", "OnePieceActivity": "航海活动奖励",
"heart_season_buy_prop": "怦然心动道具购买", "heart_season_buy_prop": "怦然心动道具购买",
"baseSalaryExpend": "底薪", "baseSalaryExpend": "底薪",
"guildRecharge": "公会内充", "guildRecharge": "公会充值",
"blind_box_transfer_to_backpack": "商城礼物盲盒预支", "blind_box_transfer_to_backpack": "商城礼物盲盒预支",
"activity_fairy_star": "三月活动奖励" "activity_fairy_star": "三月活动奖励",
"inviteGift": "邀请礼包",
"activityReward": "活动奖励",
"taskReward": "任务奖励",
"luckyGiftReward": "幸运大暴击",
"parentAdd": "上级补差",
"januaryWishDrawal": "新语新愿",
"AprilPearlRecord": "四月镖客行活奖励",
"bei_out_of_account": "bei+订单收入",
"dynamicGift": "动态礼物",
"whoIsUndercoverWin": "谁是卧底竞技奖励",
"NationalDayActivity": "国庆奖励",
"user_atransfer_guild": "用户转账给公会",
"guildWithdrawalPledge": "公会提现审核",
"voiceGift": "上麦送礼",
"radioStationFee": "电台收费",
"fansCharge": "粉丝收费",
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment