|
@@ -961,7 +961,7 @@ std::string HttpSocket::updateuserscore(std::map<std::string, std::string> getda
|
|
|
|
|
|
|
|
|
//用户不存在不减商家的分数
|
|
|
- auto firstuser = m_pcoll->find_one(bsoncxx::builder::stream::document{} << "userid" << tuserscore.iuserid << bsoncxx::builder::stream::finalize);
|
|
|
+ auto firstuser = m_pcoll->find_one(bsoncxx::builder::stream::document{} << "account" << tuserscore.account.c_str() << bsoncxx::builder::stream::finalize);
|
|
|
if (!firstuser || firstuser->view()["spreaderid"])
|
|
|
{
|
|
|
strret = funclib::rettojson(11, "user is not exist");
|
|
@@ -1225,7 +1225,7 @@ std::string HttpSocket::updateuserscore(std::map<std::string, std::string> getda
|
|
|
}
|
|
|
|
|
|
//用户不存在不能下分
|
|
|
- auto userretscore = m_pcoll->find_one(bsoncxx::builder::stream::document{} << "userid" << tuserscore.iuserid << bsoncxx::builder::stream::finalize);
|
|
|
+ auto userretscore = m_pcoll->find_one(bsoncxx::builder::stream::document{} << "account" << tuserscore.account.c_str() << bsoncxx::builder::stream::finalize);
|
|
|
if (!userretscore || !userretscore->view()["userid"])
|
|
|
{
|
|
|
strret = funclib::rettojson(Err_No_Player, "user isnot exist");
|
|
@@ -1234,7 +1234,7 @@ std::string HttpSocket::updateuserscore(std::map<std::string, std::string> getda
|
|
|
|
|
|
|
|
|
//玩家在玩游戏不能下分
|
|
|
- auto vipuser = m_pplayuseronline->find_one(bsoncxx::builder::stream::document{} << "userid" << tuserscore.iuserid << bsoncxx::builder::stream::finalize);
|
|
|
+ auto vipuser = m_pplayuseronline->find_one(bsoncxx::builder::stream::document{} << "account" << tuserscore.account.c_str() << bsoncxx::builder::stream::finalize);
|
|
|
if (vipuser)
|
|
|
{
|
|
|
strret = funclib::rettojson(Err_Player_InGame, "user is playing");
|
|
@@ -1290,7 +1290,7 @@ std::string HttpSocket::updateuserscore(std::map<std::string, std::string> getda
|
|
|
|
|
|
//减用户分数
|
|
|
tuserscore.score = -1 * tuserscore.score;
|
|
|
- auto usercriteria = make_document(kvp("userid", tuserscore.iuserid));
|
|
|
+ auto usercriteria = make_document(kvp("account", tuserscore.account.c_str()));
|
|
|
auto userupdate = make_document(kvp("$inc", make_document(kvp("score", tuserscore.score))));
|
|
|
auto tempscore = m_pcoll->find_one_and_update(usercriteria.view(), userupdate.view());
|
|
|
if (!tempscore)
|