Exemplo n.º 1
0
 /**
  * 删除游戏物品道具信息
  * @param $itemIndex
  */
 public function DelGameItem($itemIndex)
 {
     AddBMAccountEventLog("删除游戏道具物品ID:" . $itemIndex, 2);
     if (!isset($_SESSION['account_ID'])) {
         return new ExcuteResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1");
     }
     $sql = "DELETE FROM  bm_item WHERE bm_ItemID = " . $itemIndex;
     $r = sql_query($sql);
     if ($r != 0) {
         return new ExcuteResult(ResultStateLevel::SUCCESS, "", NULL);
     } else {
         return new ExcuteResult(ResultStateLevel::EXCEPTION, "执行出错", NULL);
     }
 }
Exemplo n.º 2
0
 /**
  * 修改品牌
  * @param $id
  * @param $name
  * @param $order
  * @param $state
  */
 public function updateGoodsBrand($id, $name, $order, $state)
 {
     AddBMAccountEventLog("修改品牌:" . $name, EventLogTypeEnum::BASEMANGE);
     if (!isset($_SESSION['account_ID'])) {
         return new ExcuteResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1");
     }
     $sql = "UPDATE bm_goods_brand SET brand_name = {$name}, brand_order =  {$order}, brand_state = {$state}  WHERE brand_id = {$id}";
     $r = sql_query($sql);
     if ($r != 0) {
         return new ExcuteResult(ResultStateLevel::SUCCESS, "", $r[0]);
     } else {
         return new ExcuteResult(ResultStateLevel::EXCEPTION, "执行出错", NULL);
     }
 }
 /**
  * 更改卡批次状态 以及有效期
  * @param unknown_type $GroupID
  * @param unknown_type $State
  * @param unknown_type $StartTime
  * @param unknown_type $EndTime
  */
 public function UpdateCardGroupInfo($GroupID, $State, $StartTime, $EndTime)
 {
     AddBMAccountEventLog("修改卡批次信息ID:" . $GroupID . ",状态:" . $State . ",时间:" . $StartTime . "-" . $EndTime, EventLogTypeEnum::CARDMANAGE);
     if (!isset($_SESSION['account_ID'])) {
         return new ExcuteResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1");
     }
     $sql = "UPDATE CD_CardGroup SET cd_GroupState = " . $State . ", cd_ChargeStartTime = '" . $StartTime . "'";
     $sql .= ", cd_ChargeEndTime = '" . $EndTime . "'  where cd_CroupID = " . $GroupID;
     $r = sql_query($sql);
     if ($r != 0) {
         return new ExcuteResult(ResultStateLevel::SUCCESS, "", NULL);
     } else {
         return new ExcuteResult(ResultStateLevel::EXCEPTION, "执行出错", NULL);
     }
 }
Exemplo n.º 4
0
 /**
  * 更新指定分组信息
  * @param $groupId
  * @param $ary
  */
 public function UpdateGroup($groupId, $ary = array())
 {
     AddBMAccountEventLog("修改分组ID:" . $groupId, EventLogTypeEnum::BASEMANGE);
     if (!isset($_SESSION['account_ID'])) {
         return new ExcuteResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1");
     }
     foreach (array_keys($ary) as $k => $v) {
         $attribute[] = "`{$v}` = '" . $ary[$v] . "'";
     }
     $sql = "UPDATE BM_Group SET " . implode(",", $attribute) . " WHERE bm_GroupID = {$groupId}";
     $r = sql_query($sql);
     if ($r != 0) {
         return new ExcuteResult(ResultStateLevel::SUCCESS, "", $r[0]);
     } else {
         return new ExcuteResult(ResultStateLevel::EXCEPTION, "执行出错", NULL);
     }
 }
Exemplo n.º 5
0
 /**
  * 账号登陆
  * @param unknown_type $Account
  * @param unknown_type $PWD
  */
 public function Login($Account, $PWD)
 {
     $sql = "SELECT * FROM bm_account WHERE bm_Account = '" . $Account . "' AND bm_Password = '" . md5($PWD) . "' AND bm_AccountState != 99";
     $r = sql_fetch_one($sql);
     if ($r != "") {
         AddBMAccountEventLog("账号登陆:" . $Account, 1);
         $accountMDL = new AccountMDL($r[0], $r[1], $r[2], $r[3], $r[4], $r[5], $r[6], $r[7], $r[8], $r[9], $r[10]);
         $_SESSION['account_ID'] = $accountMDL->bm_AccountID;
         $_SESSION['user'] = $accountMDL->bm_AccountName;
         return new DataResult(ResultStateLevel::SUCCESS, "", NULL, NULL);
     } else {
         return new DataResult(ResultStateLevel::ERROR, "账号不存在或密码错误", NULL, NULL);
     }
 }
Exemplo n.º 6
0
 /**
  * 提取卡,更新订单状态
  * @param $FormID
  */
 public function UpdateCardFormState($FormID)
 {
     AddBMAccountEventLog("提取卡订单号:" . $FormID, EventLogTypeEnum::CARDMANAGE);
     if (!isset($_SESSION['account_ID']) || !isset($_SESSION['user'])) {
         return new ExcuteResult(ResultStateLevel::ERROR, "账号已登出,请重新登陆!", "-1");
     }
     $Account = $_SESSION['user'];
     $Time = date("Y-m-d H:i:s");
     $sql = "UPDATE CD_CardApplyForm SET cd_CAFormState = 2, cd_CardPicker = '" . $Account . "'";
     $sql .= ", cd_CardPickTime = '" . $Time . "'";
     $sql .= " WHERE cd_CAFormState = 1 AND cd_CAFormID = " . $FormID;
     $r = sql_query($sql);
     if ($r != 0) {
         return new ExcuteResult(ResultStateLevel::SUCCESS, "", $r[0]);
     } else {
         return new ExcuteResult(ResultStateLevel::EXCEPTION, "执行出错", NULL);
     }
 }
Exemplo n.º 7
0
 /**
  * 修改物品类别3
  * @param $id
  * @param $type2_id
  * @param $name
  * @param $order
  * @param $state
  */
 public function updateGoodsType3($id, $type2_id, $name, $order, $state)
 {
     AddBMAccountEventLog("修改商品类别3:" . $name, EventLogTypeEnum::BASEMANGE);
     if (!isset($_SESSION['account_ID'])) {
         return new ExcuteResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1");
     }
     $sql = "UPDATE bm_goods_type3 SET type2_id = '{$type2_id}', type3_name = '{$name}', type3_order =  '{$order}' , type3_state = '{$state}' WHERE type3_id = '{$id}'";
     $r = sql_query($sql);
     if ($r != 0) {
         return new ExcuteResult(ResultStateLevel::SUCCESS, "", $r[0]);
     } else {
         return new ExcuteResult(ResultStateLevel::EXCEPTION, "执行出错", NULL);
     }
 }
Exemplo n.º 8
0
 /**
  * 更新卡的道具绑定信息
  * @param $cardTypeID
  * @param $gameStr
  */
 public function UpdateCardItemInfo($cardTypeID, $gameStr)
 {
     $sqlCheck = "SELECT cd_CardTypeID FROM CD_CardType WHERE cd_CardTypeID = " . $cardTypeID . "AND cardState < 99 ";
     $check = sql_check($sqlCheck);
     if ($check) {
         return new ExcuteResult(ResultStateLevel::EXCEPTION, "卡不存在", $cardTypeID);
     }
     AddBMAccountEventLog("删除卡种类ID:" . $cardTypeID, EventLogTypeEnum::CARDMANAGE);
     if (!isset($_SESSION['account_ID'])) {
         return new ExcuteResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1");
     }
     $sqldel = "delete from cd_cardaffixitem where cd_CardTypeID = " . $cardTypeID;
     $rDell = sql_query($sqldel);
     if ($rDell == 0) {
         return new ExcuteResult(ResultStateLevel::ERROR, "更新卡道具失败");
     }
     if (empty($gameStr)) {
         return new ExcuteResult(ResultStateLevel::SUCCESS, "", NULL);
     }
     $arr = array("NULL" => $cardTypeID);
     $addStr = strtr($gameStr, $arr);
     $sqladd = "insert into cd_cardaffixitem (cd_CardTypeID,bm_ItemID,cd_CardItemNum) values " . $addStr;
     $add = sql_query($sqladd);
     if ($add == 0) {
         return new ExcuteResult(ResultStateLevel::ERROR, "非常抱歉,更新卡道具失败,原先的道具绑定已删除!", $sqladd);
     } else {
         return new ExcuteResult(ResultStateLevel::SUCCESS, "", NULL);
     }
 }
Exemplo n.º 9
0
 /**
  * 删除功能模块
  * @param $moduleID
  */
 public function DelModule($moduleID)
 {
     AddBMAccountEventLog("删除功能模块ID:" . $moduleID, EventLogTypeEnum::BASEMANGE);
     if (!isset($_SESSION['account_ID'])) {
         return new ExcuteResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1");
     }
     if (empty($moduleID)) {
         return new ExcuteResult(ResultStateLevel::EXCEPTION, "执行出错", NULL);
     }
     $sql = "UPDATE bm_module SET bm_ModuleState = 99 WHERE bm_ModuleID = {$moduleID}";
     $r = sql_query($sql);
     if ($r != 0) {
         return new ExcuteResult(ResultStateLevel::SUCCESS, "", 1);
     } else {
         return new ExcuteResult(ResultStateLevel::EXCEPTION, "执行出错1", NULL);
     }
 }
Exemplo n.º 10
0
 /**
  * 账号登陆
  * @param unknown_type $Account
  * @param unknown_type $PWD
  */
 public function Login($Account, $PWD)
 {
     $sql = "SELECT account_id,account_name,account_type FROM bm_account WHERE account = '" . $Account . "' AND account_pasword = '" . md5($PWD) . "' AND account_state != 99";
     $r = sql_fetch_one($sql);
     if ($r != "") {
         //$accountMDL = new AccountMDL($r[0],$r[1]);
         if (!isset($_SESSION)) {
             session_start();
         }
         $_SESSION['account_ID'] = $r[0];
         $_SESSION['user'] = $r[1];
         //$accountMDL->acct_name;
         $_SESSION['account_type'] = $r[2];
         AddBMAccountEventLog("账号登陆:" . $Account, 1);
         return new DataResult(ResultStateLevel::SUCCESS, "", NULL, NULL);
     } else {
         return new DataResult(ResultStateLevel::ERROR, "账号不存在或密码错误", NULL, NULL);
     }
 }
Exemplo n.º 11
0
 /**
  * 删除物品
  */
 public function DeleteGoods($goodsId)
 {
     AddBMAccountEventLog("删除物品:" . $goodsId, EventLogTypeEnum::BASEMANGE);
     if (!isset($_SESSION['account_ID'])) {
         return new ExcuteResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1");
     }
     if (empty($goodsId)) {
         return new ExcuteResult(ResultStateLevel::EXCEPTION, "执行出错", NULL);
     }
     $account_id = $_SESSION['account_ID'];
     $sql = "UPDATE bm_goods SET goods_state = 99 WHERE goods_id = " . $goodsId . " and account_id = " . $account_id;
     $r = sql_query($sql);
     if ($r != 0) {
         return new ExcuteResult(ResultStateLevel::SUCCESS, "", 1);
     } else {
         return new ExcuteResult(ResultStateLevel::EXCEPTION, "执行出错1", NULL);
     }
 }
Exemplo n.º 12
0
 /**
  * 更新指定分组功能模块权限
  * @param unknown_type $GroupID
  * @param unknown_type $addStr
  * @param unknown_type $delStr
  */
 public function UpdateGroupMoudleRights($GroupID, $addStr, $delStr)
 {
     AddBMAccountEventLog("更新分组模块权限ID:" . $GroupID . ",新增:" . $addStr . ",删除:" . $delStr, EventLogTypeEnum::BASEMANGE);
     if (!isset($_SESSION['account_ID'])) {
         return new ExcuteResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1");
     }
     try {
         $msg = "";
         if (!empty($delStr)) {
             $sqldel = "delete from BM_GroupModule where bm_GroupID = " . $GroupID . " AND bm_ModuleID IN (" . $delStr . ")";
             $r = sql_query($sqldel);
             if ($r == 0) {
                 $msg = "删除分组模块权限失败!";
             }
         }
         if (!empty($addStr)) {
             $sqladd = "insert into BM_GroupModule (bm_GroupID,bm_ModuleID) values " . $addStr;
             $add = sql_query($sqladd);
             if ($add == 0) {
                 $msg .= "新增分组模块权限失败!";
             }
         }
         return new ExcuteResult(ResultStateLevel::SUCCESS, $msg, NULL);
     } catch (Exception $e) {
         return new ExcuteResult(ResultStateLevel::ERROR, "异常抛出", NULL);
     }
 }