|
@@ -801,7 +801,7 @@ std::string HttpSocket::regaccount(std::map<std::string, std::string> getdata)
|
|
|
auto userbuilder = bsoncxx::builder::stream::document{};
|
|
|
userbuilder << "userid" << userid << "gameid" << gameid << "areaid" << iareaid << "devicetype" << izero32 << "name" << strname.c_str() << "state" << izero32 << "usertype" << izero32
|
|
|
<< "userright" << izero32 << "score" << iscore << "insurescore" << izero64 << "spreaderid" << adminuserid << "spreaderidall" << strspreaderidall.c_str()
|
|
|
- << "logontime" << izero64 << "account" << straccount.c_str() << "nickname" << straccount.c_str() << "faceid" << izero32
|
|
|
+ << "logontime" << izero64 << "account" << straccount.c_str() << "webuser" << straccount.c_str() << "nickname" << straccount.c_str() << "faceid" << izero32
|
|
|
<< "logonpwd" << strpwd.c_str() << "insurepwd" << strpwd.c_str() << "lastlogonmachineid" << strmac.c_str()
|
|
|
<< "regstermachineid" << strmac.c_str() << "lastlogonip" << registerip.c_str() << "registerlogonip" << registerip.c_str() << "registerdate" << inserttime
|
|
|
<< "dynamicpass" << strmac.c_str() << "mobilephone" << strmobilephone.c_str() << "info" << strinfo.c_str();
|
|
@@ -976,8 +976,8 @@ 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);
|
|
|
- if (!firstuser || firstuser->view()["spreaderid"])
|
|
|
+ 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");
|
|
|
return strret;
|
|
@@ -1240,7 +1240,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");
|
|
@@ -1249,7 +1249,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");
|
|
@@ -1305,7 +1305,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)
|