1
This commit is contained in:
parent
72f8a332b6
commit
60c75adea8
@ -253,17 +253,31 @@ void Player::_CMFriendApplyList(f8::MsgHdr& hdr, const cs::CMFriendApplyList& ms
|
|||||||
paging_copy->set_page_size(20);
|
paging_copy->set_page_size(20);
|
||||||
#endif
|
#endif
|
||||||
a8::XObject conn_info = DBEngine::Instance()->GetConnInfo(myself.crc32_code);
|
a8::XObject conn_info = DBEngine::Instance()->GetConnInfo(myself.crc32_code);
|
||||||
|
std::string fmtstr = "'',";
|
||||||
|
std::vector<a8::XValue> sql_params;
|
||||||
|
{
|
||||||
|
sql_params.push_back(a8::XValue(last_apply_idx_));
|
||||||
|
sql_params.push_back(a8::XValue(myself.base_data.account_id));
|
||||||
|
|
||||||
|
for (auto& pair : black_hash_) {
|
||||||
|
fmtstr += "'%s',";
|
||||||
|
sql_params.push_back(a8::XValue(pair.second->base_data.account_id));
|
||||||
|
}
|
||||||
|
if (!fmtstr.empty()) {
|
||||||
|
fmtstr = fmtstr.substr(0, fmtstr.size() - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
DBEngine::Instance()->ExecAsyncQuery
|
DBEngine::Instance()->ExecAsyncQuery
|
||||||
(
|
(
|
||||||
conn_info,
|
conn_info,
|
||||||
"SELECT idx, applyid, target_id, sender_id, sender_nickname, "
|
(
|
||||||
" sender_avatar_url, sender_sex, sender_data_version1, "
|
"SELECT idx, applyid, target_id, sender_id, sender_nickname, "
|
||||||
" sender_user_value1, sender_user_value2, sender_user_value3, status "
|
" sender_avatar_url, sender_sex, sender_data_version1, "
|
||||||
"FROM friend_apply WHERE idx > %d AND target_id='%s' AND status=0;",
|
" sender_user_value1, sender_user_value2, sender_user_value3, status "
|
||||||
{
|
"FROM friend_apply WHERE idx > %d AND target_id='%s' AND status=0 "
|
||||||
last_apply_idx_,
|
" AND sender_id NOT IN(" + fmtstr + ");"
|
||||||
myself.base_data.account_id
|
).c_str(),
|
||||||
},
|
sql_params,
|
||||||
a8::XParams()
|
a8::XParams()
|
||||||
.SetSender(myself.base_data.account_id)
|
.SetSender(myself.base_data.account_id)
|
||||||
.SetParam1(hdr.socket_handle)
|
.SetParam1(hdr.socket_handle)
|
||||||
@ -1277,11 +1291,28 @@ void Player::RecalcRedPoint()
|
|||||||
};
|
};
|
||||||
|
|
||||||
a8::XObject conn_info = DBEngine::Instance()->GetConnInfo(myself.crc32_code);
|
a8::XObject conn_info = DBEngine::Instance()->GetConnInfo(myself.crc32_code);
|
||||||
|
std::string fmtstr = "'',";
|
||||||
|
std::vector<a8::XValue> sql_params;
|
||||||
|
{
|
||||||
|
sql_params.push_back(a8::XValue(last_apply_idx_));
|
||||||
|
sql_params.push_back(a8::XValue(myself.base_data.account_id));
|
||||||
|
|
||||||
|
for (auto& pair : black_hash_) {
|
||||||
|
fmtstr += "'%s',";
|
||||||
|
sql_params.push_back(a8::XValue(pair.second->base_data.account_id));
|
||||||
|
}
|
||||||
|
if (!fmtstr.empty()) {
|
||||||
|
fmtstr = fmtstr.substr(0, fmtstr.size() - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
DBEngine::Instance()->ExecAsyncQuery
|
DBEngine::Instance()->ExecAsyncQuery
|
||||||
(
|
(
|
||||||
conn_info,
|
conn_info,
|
||||||
"SELECT idx, applyid "
|
(
|
||||||
"FROM friend_apply WHERE idx > %d AND target_id='%s' AND status=0 LIMIT 1;",
|
"SELECT idx, applyid "
|
||||||
|
"FROM friend_apply WHERE idx > %d AND target_id='%s' AND status=0 "
|
||||||
|
" AND sender_id NOT IN(" + fmtstr + ") LIMIT 1;"
|
||||||
|
).c_str(),
|
||||||
{
|
{
|
||||||
last_apply_idx_,
|
last_apply_idx_,
|
||||||
myself.base_data.account_id
|
myself.base_data.account_id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user