Ejemplo n.º 1
0
 /**
  * 获取账号列表
  * @param $offer
  * @param $pageSize
  * @param $account
  */
 public function ListAllAccount($offer, $pageSize, $account, $type)
 {
     if (!isset($_SESSION)) {
         session_start();
     }
     if (!isset($_SESSION['account_ID'])) {
         return new DataResult(ResultStateLevel::ERROR, "The accounts have been logged out, please re-login account", "-1", NULL);
     }
     $where = "";
     if (!empty($account)) {
         if ($type == 1) {
             $where = " AND account_id = '" . $account . "'";
         } else {
             if ($type == 2) {
                 $where = " AND account_name like '%" . $account . "%'";
             }
         }
     }
     $sql = "SELECT * FROM bm_account WHERE account_state < 99" . $where . " ORDER BY account_id DESC LIMIT {$offer}, {$pageSize}";
     //	return new DataResult(ResultStateLevel::ERROR,$sql,$sql,NULL);
     $r = sql_fetch_rows($sql);
     if (!empty($r)) {
         $ary = array();
         foreach ($r as $k => $v) {
             $accountMDL = new AccountMDL($v[0], $v[1], $v[2], $v[3], $v[4], $v[5], $v[6], $v[7], $v[8], $v[9]);
             $ary[] = $accountMDL;
         }
         $count = sql_fetch_one_cell("SELECT COUNT(*) as num FROM bm_account WHERE account_state < 99 ");
         return new DataResult(ResultStateLevel::SUCCESS, "1", $count, $ary);
     } else {
         return new DataResult(ResultStateLevel::ERROR, "0", $sql, NULL);
     }
 }
Ejemplo n.º 2
0
 public function ListGoods($lv, $type3_id, $brand_id, $offer, $pageSize)
 {
     $brand_id = intval($brand_id);
     if ($brand_id > 0) {
         $where = sprintf(" a.brand_id = %d  and  ", $brand_id);
     } else {
         $where = "";
     }
     if ($lv == "1") {
         $from = " bm_goods a, bm_goods_type3 b, bm_goods_type2 c ";
         $where = $where . "c.type1_id = " . $type3_id . " and c.type2_id = b.type2_id and b.type3_id = a.type3_id and goods_state < 99 ";
     } else {
         if ($lv == "2") {
             $from = " bm_goods a, bm_goods_type3 b";
             $where = $where . "b.type2_id  = " . $type3_id . " and b.type3_id = a.type3_id and goods_state < 99 ";
         } else {
             if ($lv == "3") {
                 $from = " bm_goods a";
                 $where = $where . " a.type3_id  = " . $type3_id . "  and goods_state < 99 ";
             } else {
                 $from = " bm_goods a";
                 $where = $where . "goods_state < 99 ";
             }
         }
     }
     $sql = "SELECT a.* FROM" . $from . " where " . $where . "ORDER BY goods_id DESC LIMIT " . $offer . "," . $pageSize;
     $r = sql_fetch_rows($sql);
     if (!empty($r)) {
         $o = array();
         $count = count($r);
         for ($i = 0; $i < $count; $i++) {
             $goodsMDL = $r[$i];
             $goodsMDL = new GoodsMDL($goodsMDL[0], $goodsMDL[1], $goodsMDL[2], $goodsMDL[3], $goodsMDL[4], $goodsMDL[5], $goodsMDL[6], $goodsMDL[7], $goodsMDL[8], $goodsMDL[9], $goodsMDL[10], $goodsMDL[11], $goodsMDL[12], $goodsMDL[13], $goodsMDL[14], $goodsMDL[15]);
             $o[] = $goodsMDL;
         }
         $count = sql_fetch_one_cell("SELECT count() FROM " . $from . " where " . $where . ";");
         //return new DataResult(ResultStateLevel::ERROR,"0",$sql,NULL);
         return new DataResult(ResultStateLevel::SUCCESS, "1", $count, $o);
     } else {
         return new DataResult(ResultStateLevel::ERROR, "0", $sql, NULL);
     }
 }
Ejemplo n.º 3
0
 public function ListStore()
 {
     if (!isset($_SESSION['account_ID'])) {
         return new ExcuteResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1");
     }
     $account_id = $_SESSION['account_ID'];
     $sql = "SELECT * FROM bm_store_info WHERE account_id = " . $account_id . " and shop_state < 99;";
     $r = sql_fetch_rows($sql);
     if (!empty($r)) {
         $o = array();
         $count = count($r);
         for ($i = 0; $i < $count; $i++) {
             $storeMDL = $r[$i];
             $storeMDL = new StoreMDL($storeMDL[0], $storeMDL[1], $storeMDL[2], $storeMDL[3], $storeMDL[4], $storeMDL[5], $storeMDL[6], $storeMDL[7], $storeMDL[8], $storeMDL[9]);
             $o[] = $storeMDL;
         }
         return new DataResult(ResultStateLevel::SUCCESS, "1", 0, $o);
     } else {
         return new DataResult(ResultStateLevel::ERROR, "0", $sql, NULL);
     }
 }
Ejemplo n.º 4
0
 public function ListShoppingCart()
 {
     if (!isset($_SESSION['account_ID'])) {
         return new ExcuteResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1");
     }
     $account_id = $_SESSION['account_ID'];
     $sql = "SELECT a.shopping_cart_id,a.account_id,a.goods_num,a.add_time,\r\nb.goods_id,b.goods_barcode,b.goods_name,b.goods_unit,b.goods_weight,b.goods_active_stime,b.goods_active_etime,b.goods_pic_url,b.goods_number,b.goods_price,b.goods_active_price\r\n FROM bm_shopping_cart a,bm_goods b WHERE a.account_id = " . $account_id . " AND a.goods_id = b.goods_id AND b.goods_state < 99 ORDER BY a.shopping_cart_id;";
     $r = sql_fetch_rows($sql);
     if (!empty($r)) {
         $o = array();
         $count = count($r);
         for ($i = 0; $i < $count; $i++) {
             $shoppingCartMDL = $r[$i];
             $goodsSimpleMDL = new GoodsSimpleMDL($shoppingCartMDL[4], $shoppingCartMDL[5], $shoppingCartMDL[6], $shoppingCartMDL[7], $shoppingCartMDL[8], $shoppingCartMDL[9], $shoppingCartMDL[10], $shoppingCartMDL[11], $shoppingCartMDL[12], $shoppingCartMDL[13], $shoppingCartMDL[14]);
             $shoppingCartMDL = new ShoppingCartMDL($shoppingCartMDL[0], $shoppingCartMDL[1], $shoppingCartMDL[2], $shoppingCartMDL[3], $goodsSimpleMDL);
             $o[] = $shoppingCartMDL;
         }
         return new DataResult(ResultStateLevel::SUCCESS, "1", 0, $o);
     } else {
         return new DataResult(ResultStateLevel::ERROR, "0", $sql, NULL);
     }
 }
Ejemplo n.º 5
0
 /**
  * 获取所有分组信息
  */
 public function ListAll()
 {
     if (!isset($_SESSION)) {
         session_start();
     }
     if (!isset($_SESSION['account_ID'])) {
         return new DataResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1", NULL);
     }
     $sql = sprintf("SELECT * FROM BM_Group");
     $r = sql_fetch_rows($sql);
     if ($r != "") {
         $o = array();
         $count = count($r);
         for ($i = 0; $i < $count; $i++) {
             $groupMDL = $r[$i];
             $groupMDL = new GroupMDL($groupMDL[0], $groupMDL[1], $groupMDL[2]);
             $o[] = $groupMDL;
         }
         return new DataResult(ResultStateLevel::SUCCESS, "1", $count, $o);
     } else {
         return new DataResult(ResultStateLevel::ERROR, "0", NULL, NULL);
     }
 }
Ejemplo n.º 6
0
 /**
  * 获取卡批次列表
  * @param unknown_type $FormName 卡申请单名称
  * @param unknown_type $offer
  * @param unknown_type $pageSize
  */
 public function ListCardGroup($FormName, $offer, $pageSize)
 {
     if (!isset($_SESSION)) {
         session_start();
     }
     if (!isset($_SESSION['account_ID'])) {
         return new DataResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1", NULL);
     }
     $sql = "SELECT b.cd_CAFormName,b.cd_CardApplyer,b.cd_CAFormChecker,b.cd_CardPicker,a.*,c.cd_CardTypeName";
     $sql .= " FROM CD_CardGroup a,CD_CardApplyForm b,CD_CardType c";
     $sql .= " WHERE a.cd_CAFormID = b.cd_CAFormID AND a.cd_CardTypeID = c.cd_CardTypeID AND b.cd_CAFormName like '%" . $FormName . "%'  ORDER BY cd_Createtime DESC LIMIT {$offer}, {$pageSize}";
     $r = sql_fetch_rows($sql);
     if (!empty($r)) {
         $ary = array();
         foreach ($r as $k => $v) {
             $cardGroupMDL = new CardGroupMDL($v[4], $v[5], $v[6], $v[7], $v[8], $v[9], $v[10], $v[11], $v[12], $v[0], $v[1], $v[2], $v[3], $v[13]);
             $ary[] = $cardGroupMDL;
         }
         $count = sql_fetch_one_cell("SELECT COUNT(1) AS num FROM CD_CardGroup a,CD_CardApplyForm b WHERE a.cd_CAFormID = b.cd_CAFormID AND b.cd_CAFormName like '%" . $FormName . "%'");
         return new DataResult(ResultStateLevel::SUCCESS, "1", $count, $ary);
     } else {
         return new DataResult(ResultStateLevel::ERROR, "0", $sql, NULL);
     }
 }
Ejemplo n.º 7
0
 /**
  * 获取申请单列表信息
  * @param unknown_type $areaId
  * @param unknown_type $serverId
  * @param unknown_type $state
  * @param unknown_type $offer
  * @param unknown_type $pageSize
  * 申请单编号=0,服务器ID=1,服务器名称=2,标题=3,详情=4,
  * 发送类型=5 账号=6,账号条件=7,货币=8,道具=9,申请原因=10,申请状态=11
  * 申请时间=12,申请账号=13,审核账号=14,审核说明=15,审核时间=16
  */
 public static function dataMentods_ListApplyItem($areaId, $serverId, $state, $offer, $pageSize)
 {
     if (!isset($_SESSION)) {
         session_start();
     }
     if (!isset($_SESSION['user'])) {
         return new ExcuteResult(ResultStateLevel::ERROR, "The accounts have been logged out, please re-login account", "-1");
     }
     $accountName = $_SESSION['user'];
     $accountId = $_SESSION['account_ID'];
     $sql = 'SELECT bm_gameApplayId,a.bm_serverID,bm_serverName,bm_applyTitle,bm_applyDesc,';
     $sql .= ' bm_sendType,bm_sendUser,bm_condition,bm_moneyItem,bm_propItem,bm_applyRemark,bm_applyState,';
     $sql .= ' bm_applyTime,bm_applyAccount,bm_checkAccount,bm_checkRemark,bm_checkTime ';
     $sqlWhere = ' FROM bm_gameapply a,bm_accountgameserver b';
     if ($state == 0) {
         $sqlWhere .= ' WHERE a.bm_serverID = b.bm_ServerID AND b.bm_AccountID = ' . $accountId . ' AND bm_applyState = ' . $state;
     } else {
         $sqlWhere .= ' WHERE a.bm_serverID = b.bm_ServerID AND b.bm_AccountID = ' . $accountId . ' AND bm_applyState >= ' . $state;
     }
     if ($areaId != "") {
         $sqlWhere .= '  AND b.bm_AreaID = ' . $areaId;
     }
     if ($serverId != "") {
         $sqlWhere .= '  AND  b.bm_ServerID IN (' . $serverId . ')';
     }
     $sql .= $sqlWhere . " ORDER BY bm_applyTime DESC LIMIT {$offer}, {$pageSize}";
     $r = sql_fetch_rows($sql);
     if (!empty($r)) {
         $count = sql_fetch_one_cell("SELECT COUNT(*) as num " . $sqlWhere);
         return new DataResult(ResultStateLevel::SUCCESS, "1", $count, $r);
     } else {
         return new DataResult(ResultStateLevel::ERROR, "0", $sql, NULL);
     }
 }
Ejemplo n.º 8
0
 public function ListBuyType($lv, $type3_id)
 {
     if (!isset($_SESSION)) {
         session_start();
     }
     if (!isset($_SESSION['account_ID'])) {
         return new DataResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1", NULL);
     }
     if ($lv == "1") {
         $sql = sprintf("SELECT DISTINCT a.* FROM  bm_goods_brand a, bm_goods_type3 b, bm_goods_type2 c, bm_brand_type3 d where c.type1_id = %d and" . "c.type2_id = b.type2_id and b.type3_id = d.type3_id and a.brand_id = d.brand_id  and a.brand_state < 99 ORDER BY brand_order;", $type3_id);
     } else {
         if ($lv == "2") {
             $sql = sprintf("SELECT DISTINCT a.* FROM bm_goods_brand a, bm_goods_type3 b, bm_brand_type3 d  where b.type2_id =%d " . " and a.brand_id = d.brand_id and a.brand_state < 99 ORDER BY a.brand_order;", $type3_id);
         } else {
             if ($lv == "3") {
                 $sql = sprintf("SELECT a.* FROM bm_goods_brand a, bm_brand_type3 b where b.type3_id = %d and a.brand_id = b.brand_id and a.brand_state < 99 ORDER BY a.brand_order;", $type3_id);
             } else {
                 $sql = sprintf("SELECT * FROM bm_goods_brand where brand_state < 99 ORDER BY brand_order;");
             }
         }
     }
     $r = sql_fetch_rows($sql);
     if ($r != "") {
         $o = array();
         $count = count($r);
         for ($i = 0; $i < $count; $i++) {
             $goodsBrandMDL = $r[$i];
             $goodsBrandMDL = new GoodsBrandMDL($goodsBrandMDL[0], $goodsBrandMDL[1], $goodsBrandMDL[2], $goodsBrandMDL[3]);
             $o[] = $goodsBrandMDL;
         }
         return new DataResult(ResultStateLevel::SUCCESS, 1, $count, $o);
     } else {
         return new DataResult(ResultStateLevel::ERROR, "0", NULL, NULL);
     }
 }
Ejemplo n.º 9
0
 public function getBossTemplate()
 {
     $sql = "SELECT \t\r\n\t\tboss_id, \r\n\t\tboss_type,\r\n\t\tmap_id,\r\n\t\trelive_time,\r\n\t\trelive_time2,\r\n\t\tname,\r\n\t\tlevel,\r\n\t\tremark,\r\n\t\tdorp,\r\n\t\trelive_position\r\n\t\tFROM \r\n\t\tt_boss_template  \r\n\t\tORDER BY level;";
     $r = sql_fetch_rows($sql);
     $o = array();
     if ($r != "") {
         $count = count($r);
         $lable = array("int", "int", "int", "int", "string", "string", "int", "string", "string", "string");
         for ($i = 0; $i < $count; $i++) {
             $item = $r[$i];
             $o[] = $item;
         }
         return new DataResult(ResultStateLevel::SUCCESS, "1", $lable, $o);
     } else {
         return new DataResult(ResultStateLevel::ERROR, "0", NULL, NULL);
     }
 }
Ejemplo n.º 10
0
 public function getItemFusionTemplate()
 {
     $sql = "SELECT \t\r\n\t\titem_template_id1,\r\n\t\titem_template_id2,\r\n\t\tfusion_num,\r\n\t\tfusion_template_id\r\n\t\tFROM \r\n\t\tt_item_fusion_template;";
     $r = sql_fetch_rows($sql);
     $o = array();
     if ($r != "") {
         $count = count($r);
         $lable = array("int", "int", "int", "int");
         for ($i = 0; $i < $count; $i++) {
             $item = $r[$i];
             $o[] = $item;
         }
         return new DataResult(ResultStateLevel::SUCCESS, "1", $lable, $o);
     } else {
         return new DataResult(ResultStateLevel::ERROR, "0", NULL, NULL);
     }
 }
Ejemplo n.º 11
0
 /**
  * 获取所有分组信息
  */
 public function ListAll()
 {
     if (!isset($_SESSION)) {
         session_start();
     }
     if (!isset($_SESSION['account_ID'])) {
         return new DataResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1", NULL);
     }
     $sql = sprintf("select a.type1_id,a.type1_name,b.type2_id,b.type2_name,c.type3_id,c.type3_name" . " from bm_goods_type1 a, bm_goods_type2 b, bm_goods_type3 c" . " where a.type1_id = b.type1_id and b.type2_id = c.type2_id" . " order by a.type1_order, b.type2_order, c.type3_order");
     $r = sql_fetch_rows($sql);
     if ($r != "") {
         $o = array();
         $count = count($r);
         for ($i = 0; $i < $count; $i++) {
             $goodsTypeMDL = $r[$i];
             $goodsTypeMDL = new GoodsTypeMDL($goodsTypeMDL[0], $goodsTypeMDL[1], $goodsTypeMDL[2], $goodsTypeMDL[3], $goodsTypeMDL[4], $goodsTypeMDL[5]);
             $o[] = $goodsTypeMDL;
         }
         return new DataResult(ResultStateLevel::SUCCESS, 1, $count, $o);
     } else {
         return new DataResult(ResultStateLevel::ERROR, "0", NULL, NULL);
     }
 }
Ejemplo n.º 12
0
 /**
  * 获取卡订单申请中卡种类信息
  * @param unknown_type $FormID
  */
 public function getCardListByFormID($FormID)
 {
     $sql_group = "SELECT a.cd_CroupID,b.cd_CardTypeName FROM CD_CardGroup a,CD_CardType b WHERE a.cd_CardTypeID = b.cd_CardTypeID AND a.cd_CAFormID = " . $FormID;
     $r_group = sql_fetch_rows($sql_group);
     if (!empty($r_group)) {
         $ListCard = array();
         for ($i = 0; $i < count($r_group); $i++) {
             $rightsServ = $r_group[$i];
             $sql_card = "SELECT cd_CardSN,cd_CardPassword FROM cd_card WHERE cd_CroupID = " . $rightsServ[0];
             $r_card = $r_group = sql_fetch_rows($sql_card);
             if (!empty($r_card)) {
                 $objList = array();
                 for ($j = 0; $j < count($r_card); $j++) {
                     $card = array();
                     $card[] = $r_card[$j][0];
                     $card[] = $r_card[$j][1];
                     $card[] = $rightsServ[1];
                     $objList[] = $card;
                 }
                 $ListCard[] = $objList;
             }
         }
         return new DataResult(ResultStateLevel::SUCCESS, "", NULL, $ListCard);
     } else {
         return new DataResult(ResultStateLevel::EXCEPTION, "执行错误", NULL, NULL);
     }
 }
Ejemplo n.º 13
0
 private static function getServerInfoTOhttprequest1($URI, $serverIdString)
 {
     $sql = "SELECT bm_ServerConnString,bm_ServerID FROM bm_gameserver WHERE bm_ServerID IN(" . $serverIdString . ")";
     $rs = sql_fetch_rows($sql);
     $resultArray = array();
     if (!empty($rs)) {
         foreach ($rs as $k => $v) {
             $servAry = json_decode($v[0], true);
             $host_IP = $servAry['socket']['ip'];
             $host_port = $servAry['socket']['port'];
             $ary = array();
             $ary[] = "http://" . $host_IP . ":" . $host_port . $URI;
             $ary[] = $v[1];
             $resultArray[] = $ary;
         }
     }
     return $resultArray;
 }
Ejemplo n.º 14
0
 /**
  * 游龙意见收集  暂时放在这里
  * @param $offer
  * @param $pageSize
  * @param $start
  * @param $end
  */
 public function youlongLog($offer, $pageSize, $start, $end)
 {
     if (!isset($_SESSION)) {
         session_start();
     }
     if (!isset($_SESSION['account_ID'])) {
         return new DataResult(ResultStateLevel::ERROR, "The accounts have been logged out, please re-login account", "-1", NULL);
     }
     $where = "";
     if (!empty($start) || !empty($end)) {
         $where = " where log_date >= '" . $start . "' AND log_date <='" . $end . "'";
     }
     $sql = "SELECT log_date,log_title,log_remark FROM log_youlong " . $where . " ORDER BY log_date DESC LIMIT {$offer}, {$pageSize}";
     $r = sql_fetch_rows($sql);
     if (!empty($r)) {
         $count = sql_fetch_one_cell("SELECT COUNT(*) as num FROM log_youlong " . $where);
         return new DataResult(ResultStateLevel::SUCCESS, "1", $count, $r);
     } else {
         return new DataResult(ResultStateLevel::ERROR, "0", $sql, NULL);
     }
 }
Ejemplo n.º 15
0
 /**
  * 根据条件获取物品列表。物品名称满足模糊查询,物品ID是精确查找
  * @param $offer
  * @param $pageSize
  * @param $GameID
  * @param $itemName
  * @param $type
  */
 public function GetAllGameItemByGameIDUpdate($offer, $pageSize, $GameID, $itemName, $type)
 {
     if (!isset($_SESSION)) {
         session_start();
     }
     if (!isset($_SESSION['account_ID'])) {
         return new DataResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1", NULL);
     }
     if ($type == "1") {
         $sql = "SELECT * FROM bm_item WHERE bm_GameID = " . $GameID . " AND bm_ItemGID > 100 AND bm_ItemName like '%" . $itemName . "%' ORDER BY bm_ItemID DESC LIMIT {$offer}, {$pageSize}";
         $r = sql_fetch_rows($sql);
         if (!empty($r)) {
             $ary = array();
             foreach ($r as $k => $v) {
                 $gameItemMDL = new GameItemMDL($v[0], $v[1], $v[2], $v[3], $v[4], $v[5]);
                 $ary[] = $gameItemMDL;
             }
             $count = sql_fetch_one_cell("SELECT COUNT(*) as num FROM bm_item WHERE bm_GameID = " . $GameID . " AND bm_ItemName like '%" . $itemName . "%'");
             return new DataResult(ResultStateLevel::SUCCESS, "1", $count, $ary);
         } else {
             return new DataResult(ResultStateLevel::ERROR, "0", $sql, NULL);
         }
     } else {
         $sql_ = "SELECT * FROM bm_item WHERE bm_GameID = " . $GameID . " AND bm_ItemGID = '" . $itemName . "' ORDER BY bm_ItemID DESC LIMIT {$offer}, {$pageSize}";
         $r_ = sql_fetch_rows($sql_);
         if (!empty($r_)) {
             $ary_ = array();
             foreach ($r_ as $k => $v) {
                 $gameItemMDL_ = new GameItemMDL($v[0], $v[1], $v[2], $v[3], $v[4], $v[5]);
                 $ary_[] = $gameItemMDL_;
             }
             $count_ = sql_fetch_one_cell("SELECT COUNT(*) as num FROM bm_item WHERE bm_GameID = " . $GameID . " AND bm_ItemGID = '" . $itemName . "'");
             return new DataResult(ResultStateLevel::SUCCESS, "1", $count_, $ary_);
         } else {
             return new DataResult(ResultStateLevel::ERROR, "0", $sql, NULL);
         }
     }
 }
Ejemplo n.º 16
0
 /**
  * 根据卡种类获取绑定的道具信息
  * @param $cardTypeID
  */
 public function GetCardItemByCardType($cardTypeID)
 {
     if (!isset($_SESSION)) {
         session_start();
     }
     if (!isset($_SESSION['account_ID'])) {
         return new DataResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1", NULL);
     }
     $sql = "SELECT b.bm_ItemID,b.cd_CardItemNum,a.bm_ItemName FROM  bm_item a, cd_cardaffixitem b ";
     $sql .= " WHERE a.bm_ItemID = b.bm_ItemID AND b.cd_CardTypeID = " . $cardTypeID;
     $r = sql_fetch_rows($sql);
     if (!empty($r)) {
         $ary = array();
         foreach ($r as $k => $v) {
             $ob = array();
             $ob[] = $v[0];
             $ob[] = $v[1];
             $ob[] = $v[2];
             $ary[] = $ob;
         }
         return new DataResult(ResultStateLevel::SUCCESS, "", NULL, $ary);
     } else {
         return new DataResult(ResultStateLevel::ERROR, "执行出错", NULL, NULL);
     }
 }
Ejemplo n.º 17
0
 /**
  * 判断一个模块是否当前账号有权限
  * @param $moduleID
  */
 public function IsMoudleHasRights($moduleID)
 {
     if (!isset($_SESSION)) {
         session_start();
     }
     if (!isset($_SESSION['account_ID'])) {
         return new DataResult(ResultStateLevel::ERROR, "0", NULL, NULL);
     }
     $User = $_SESSION['account_ID'];
     $sql = "SELECT a.bm_ModuleID,a.bm_ModuleName,a.bm_ModuleUrl,a.bm_FModuleID";
     $sql .= "  FROM BM_Module a,(";
     $sql .= "  SELECT b.bm_ModuleID";
     $sql .= "  FROM bm_accountgroup a,bm_groupmodule b";
     $sql .= "  WHERE a.bm_GroupID = b.bm_GroupID AND a.bm_AccountID = " . $User . " UNION ";
     $sql .= "  SELECT bm_ModuleID FROM bm_accountmodule WHERE bm_AccountID = " . $User . " ) b";
     $sql .= "  WHERE a.bm_ModuleID = b.bm_ModuleID AND a.bm_ModuleState < 99 AND a.bm_ModuleID = " . $moduleID;
     $r = sql_fetch_rows($sql);
     $ModuleList = array();
     if (count($r) > 0) {
         for ($i = 0; $i < count($r); $i++) {
             $arry = array();
             $arry[] = $r[$i][0];
             //模块ID
             $arry[] = $r[$i][1];
             //模块名称
             $arry[] = $r[$i][2];
             //模块地址
             $arry[] = $r[$i][3];
             //父模块ID
             $ModuleList[] = $arry;
         }
         return new DataResult(ResultStateLevel::SUCCESS, "", count($r), $ModuleList);
     }
     return new DataResult(ResultStateLevel::ERROR, "账号未有权限或者执行失败", NULL, NULL);
 }
Ejemplo n.º 18
0
 public function AddPurchaseInfo($purchaseID, $ary = array())
 {
     $Time = time();
     foreach (array_keys($ary) as $k => $v) {
         $attribute[] = "{$v}";
     }
     $sql = "SELECT goods_id,goods_active_etime,goods_number,goods_price,goods_active_price FROM bm_goods" . " WHERE goods_id IN (" . implode(",", $attribute) . ") AND goods_state < 99;";
     $r = sql_fetch_rows($sql);
     $count = count($r);
     $purchaseList = null;
     for ($i = 0; $i < $count; $i++) {
         $row = $r[$i];
         foreach (array_keys($ary) as $k => $v) {
             if ($v == $row[0] and $ary[$v] <= $row[2]) {
                 if ($row[1] == 0 or $row[1] <= $Time) {
                     $price = $row[3];
                     $active_etime = 0;
                 } else {
                     $price = $row[4];
                     $active_etime = $row[1];
                 }
                 $sql = "UPDATE bm_goods SET goods_number = goods_number - " . $ary[$v] . " WHERE goods_id =  " . $row[0] . ";";
                 sql_query($sql);
                 //即时更新物品库存数量
                 $purchaseList[] = "('{$purchaseID}','{$row['0']}','{$ary[$v]}','{$active_etime}','{$price}',0)";
                 break;
             }
         }
     }
     if ($purchaseList != null) {
         $sql = "INSERT INTO bm_purchase_info(purchase_id,goods_id,goods_num,goods_active_etime,purchase_goods_price,purchase_state)VALUES " . implode(",", $purchaseList) . " ;";
         $r = sql_query($sql);
         //$r = 0;
     } else {
         $r = 0;
     }
     if ($r != 0) {
         return new ExcuteResult(ResultStateLevel::SUCCESS, "", $r[0]);
     } else {
         $del = "DELETE FROM bm_purchase_list WHERE purchase_id =  " . $purchaseID . ";";
         $r = sql_query($del);
         return new ExcuteResult(ResultStateLevel::EXCEPTION, "error", $sql);
     }
 }
Ejemplo n.º 19
0
 /**
  * 不通过
  * @param unknown_type $mailID
  * @param unknown_type $remark
  */
 public function UnCheckMailApplay($mailID, $remark)
 {
     if (!isset($_SESSION['account_ID'])) {
         return new ExcuteResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1");
     }
     $sql = "SELECT g.bm_GameMailTarget, g.bm_GameMailNickName, g.bm_GameMailTitle, g.bm_GameMailDesc, g.bm_MailApplyRemark,   \r\n \t\t\t\ts.bm_ServerConnString,g.bm_ServerID FROM bm_gamemail g LEFT JOIN bm_gameserver s ON g.bm_ServerID = s.bm_ServerID\r\n \t\t\t    WHERE g.bm_GameMailID = {$mailID}";
     $rs = sql_fetch_rows($sql);
     if (empty($rs)) {
         return new ExcuteResult(ResultStateLevel::ERROR, "邮件已经不存在或者出错", "-1");
     }
     $dataAry['bm_ApplyState'] = 11;
     $dataAry['bm_CheckRemark'] = $remark;
     $dataAry['bm_CheckTime'] = date("Y-m-d H:i:s");
     $dataAry["bm_Checker"] = $_SESSION['account_ID'];
     foreach (array_keys($dataAry) as $k => $v) {
         $attribute[] = "`{$v}` = '" . $dataAry[$v] . "'";
     }
     $r_updatesql = "UPDATE bm_gamemail SET " . implode(",", $attribute) . " WHERE bm_GameMailID = {$mailID}";
     $r_checkUpdate = sql_query($r_updatesql);
     if ($r_checkUpdate != 0) {
         return new ExcuteResult(ResultStateLevel::SUCCESS, "", 1);
     } else {
         return new ExcuteResult(ResultStateLevel::EXCEPTION, "执行出错", NULL);
     }
 }
Ejemplo n.º 20
0
$fileName = "Cache/plats".date("Y-m-d").".txt";
if(file_exists($fileName))
{
	$file = fopen($fileName,"r");
	$str = fgets($file);
	fclose($file);
}
else
{
*/
if (!isset($_SESSION)) {
    session_start();
}
if (!isset($_SESSION['account_ID'])) {
    return new DataResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1", NULL);
}
$AccountID = $_SESSION['account_ID'];
$sql = "SELECT DISTINCT(b.bm_AreaID),a.bm_AreaName FROM bm_gamearea a,bm_accountgameserver b WHERE a.bm_AreaID = b.bm_AreaID AND b.bm_AccountID = " . $AccountID . " AND b.bm_GameID = 1 AND a.bm_AreaState < 99 ORDER BY b.bm_AreaID";
$dbData = sql_fetch_rows($sql);
$str = "";
for ($i = 0; $i != count($dbData); $i++) {
    $row = $dbData[$i];
    $line = $row[0] . "," . $row[1];
    $str .= "|" . $line;
}
$str = substr($str, 1);
//		$file = fopen($fileName,"w");
//		fwrite($file,$str);
//		fclose($file);
//	}
echo $str;
Ejemplo n.º 21
0
 /**
  * 获取当前登陆账号指定游戏 区权限信息 区ID,区名称
  * @param $game
  */
 public function GetAccountAreaRights($game)
 {
     if (!isset($_SESSION)) {
         session_start();
     }
     if (!isset($_SESSION['account_ID'])) {
         return new DataResult(ResultStateLevel::ERROR, "账号已登出,请重新登录", "-1", NULL);
     }
     $AccountID = $_SESSION['account_ID'];
     $sql = "SELECT a.bm_AreaID ,a.bm_AreaName FROM (SELECT DISTINCT bm_AreaID FROM bm_accountgameserver WHERE bm_AccountID = " . $AccountID . " AND bm_GameID = " . $game . ") b,bm_gamearea a  WHERE a.bm_AreaID = b.bm_AreaID ORDER BY a.bm_AreaID";
     $r = sql_fetch_rows($sql);
     $array = array();
     if (!empty($r)) {
         for ($i = 0; $i < count($r); $i++) {
             $rightsServ = $r[$i];
             $rights = array();
             $rights[] = $rightsServ[0];
             $rights[] = $rightsServ[1];
             $array[] = $rights;
         }
         return new DataResult(ResultStateLevel::SUCCESS, "1", count($r), $array);
     } else {
         return new DataResult(ResultStateLevel::ERROR, "", NULL, NULL);
     }
 }