| | |
| | | $ServerID = \CommFunc\GetServerIDBySid($RegionName); |
| | | AddAccountFirstLogin($ServerID, $roleInfo); |
| | | AddAccountDayActive($ServerID, $roleInfo); |
| | | |
| | | // 附带更新服务器角色表,之后会替换 GameRoles 表 |
| | | $find = array("Channel" => $Channel, "AccountID" => $AccountID, "ServerID" => $ServerID); |
| | | if (\DBOper\Count("ServerRoles", $find) <= 0) { |
| | | $insArray = array( |
| | | "Channel" => $Channel, |
| | | "AccountID" => $AccountID, |
| | | "ServerID" => $ServerID, |
| | | "CreateYMD" => date("Y-m-d"), |
| | | ); |
| | | if ($roleInfo["CreateRoleTime"]) { |
| | | $insArray["CreateYMD"] = substr($roleInfo["CreateRoleTime"], 0, 10); |
| | | } |
| | | $insArray["RollCount"] = \DBOper\Count("ServerRoles", array("Channel" => $Channel, "AccountID" => $AccountID)); |
| | | $insArray = array_merge($insArray, $roleInfo); |
| | | \DBOper\Insert("ServerRoles", $insArray, $find); |
| | | } else { |
| | | \DBOper\Update("ServerRoles", $find, $roleInfo, true); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | |
| | | $AccountID = $_GET["accid"]; |
| | | $code = $_GET["code"]; |
| | | $coupontype = $_GET["coupontype"]; |
| | | $CoupontypeGroup = json_decode($CoupontypeGroup); |
| | | if (!array_key_exists($coupontype, $CoupontypeGroup)) { |
| | | // \Logging\LogInfo("CoupontypeGroup 不需要记录的组:" . $coupontype); |
| | | return; |
| | | } |
| | | |
| | | $find = array("Channel" => $Channel, "AccountID" => $AccountID, "ServerID" => $ServerID); |
| | | if (!\DBOper\FindOne("CoupontypeGroup", $find, $findData)) { |