From bd670ab483e6a039ff3668099ace6f4fd0727a7f Mon Sep 17 00:00:00 2001 From: yangduo Date: Tue, 30 Jul 2024 14:46:52 +0800 Subject: [PATCH 1/6] marqueeNotice --- .../controller/TempToolsController.class.php | 1 + .../controller/UnitTestController.class.php | 44 ++++++++++ webapp/services/NoticeService.php | 80 +++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 webapp/controller/UnitTestController.class.php create mode 100644 webapp/services/NoticeService.php diff --git a/webapp/controller/TempToolsController.class.php b/webapp/controller/TempToolsController.class.php index f95f61a8..9138eba5 100644 --- a/webapp/controller/TempToolsController.class.php +++ b/webapp/controller/TempToolsController.class.php @@ -7,6 +7,7 @@ require_once('models/InGameMall.php'); require_once('services/MailApiService.php'); + use phpcommon\SqlHelper; use models\InGameMall; diff --git a/webapp/controller/UnitTestController.class.php b/webapp/controller/UnitTestController.class.php new file mode 100644 index 00000000..4a680219 --- /dev/null +++ b/webapp/controller/UnitTestController.class.php @@ -0,0 +1,44 @@ +1, + "elements"=> $elements, + ]; + return json_encode($data); + } + + public static function send($content, $loop, $interval) { + $appkey = "YOUME1838B3633FF1410BDC9124BBD806F245B9D2E5AC"; + $identifier="admin"; + $appsecret="q6B570yTyj/00Nk4mYZtgDwyew5v05t13V1vo4mxpEuAaWUiinAyVxG41sNu3vsFe8sipOLfKfIVYGhzpQrqzvj5sId3mrBfj/s65a2gp36yDrI/nX5BnUAJB317SEosR6xLoPuhBvHU+/1DWI7nKSKaRNxnQiC46PJKFc2kX50BAAE="; + + $data = [ + "Notice"=>[ + "ChannelID"=>"world_room_1",//频道 ID,app 内唯一,字符串 + "NoticeType"=>1,//1 为跑马灯公告,2 为聊天框公告,3 为置顶公告,整数 + "LoopType"=>1,// 公告循环类型,1 为一次性公告,2 为周期性公告,整数 + "Title"=>"",// 公告标题,字符串 + "Content"=>$content,//"testtttttt222",// 公告内容,字符串 + "LinkKeyWords"=>"",// 链接关键字,字符串 + "LinkAddr"=>"",// 链接地址,字符串 + "Creator"=>"",// 公告添加人,字符串 + "EnableStatus"=>2,// 公告启用状态,1 为停用,2 为启用,整数 + + "SendStartTime"=>"",// 公告发送时间,格式为 HH:MM:SS,字符串 + "SendInstantly"=>1,// 是否即时发送,也属于公告 json 里的字段。1 是,0 否,不指定则不起作用 + "SendTimes"=>$loop,// 公告发送次数,整数(需要传入) + "SendInterval"=>$interval,// 公告发送多次时,每次的间隔,单位秒,整数(需要传入) + ] + ]; + + $url = "https://sgapi.youme.im/v1/im/add_notice"; + $curtime = time(); + + $params = array( + "appkey" => $appkey, + "identifier"=> $appkey, + "curtime"=> $curtime, + "checksum"=> strtolower(sha1($appsecret.$curtime)), + ); + + $response = ''; + phpcommon\HttpClient::postContentEx($url, $params, json_encode($data), $response, ['Content-Type: application/json']); + + if (SERVER_ENV != _ONLINE) { + error_log($response); + } + } +} \ No newline at end of file From 58feefe78ef4974deea7fa5fd8945d418cbc9cde Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 31 Jul 2024 16:38:57 +0800 Subject: [PATCH 2/6] 1 --- doc/Recharge.py | 22 ------------------- .../controller/RechargeController.class.php | 21 ------------------ webapp/services/RoomBattleDataService.php | 3 ++- webapp/services/TameBattleDataService.php | 1 + 4 files changed, 3 insertions(+), 44 deletions(-) delete mode 100644 doc/Recharge.py delete mode 100644 webapp/controller/RechargeController.class.php diff --git a/doc/Recharge.py b/doc/Recharge.py deleted file mode 100644 index 106163c9..00000000 --- a/doc/Recharge.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- - -import _common - -class Recharge(object): - - def __init__(self): - self.apis = [ - { - 'name': 'goodsList', - 'desc': '充值-商品列表', - 'group': 'Recharge', - 'url': 'webapp/index.php?c=Recharge&a=goodsList', - 'params': [ - _common.ReqHead(), - ], - 'response': [ - _common.RspHead(), - ['!goods', [_common.RechargeGoods()], '商品列表'] - ] - } - ] diff --git a/webapp/controller/RechargeController.class.php b/webapp/controller/RechargeController.class.php deleted file mode 100644 index 6434012b..00000000 --- a/webapp/controller/RechargeController.class.php +++ /dev/null @@ -1,21 +0,0 @@ - $meta['id'], - 'goods_meta' => $meta, - )); - }); - myself()->_rspData(array( - 'goods' => $goods - )); - } - -} diff --git a/webapp/services/RoomBattleDataService.php b/webapp/services/RoomBattleDataService.php index 50a32728..8fee71ea 100644 --- a/webapp/services/RoomBattleDataService.php +++ b/webapp/services/RoomBattleDataService.php @@ -260,8 +260,9 @@ class RoomBattleDataService extends BaseService { //宝箱掉落 $chestLootProbArr = explode(";",$rewardMeta['chestLootProb']); $rate = isset($chestLootProbArr[$teamRank-1]) ? $chestLootProbArr[$teamRank-1] : 0; + //error_log(json_encode($member)); if ($rate > 0 && !empty($member['box_num'])){ - for ($i = 0; i < $member['box_num']; ++$i) { + for ($i = 0; $i < $member['box_num']; ++$i) { $rand = $rate * 100; $rnd = rand(1,100); if ($rnd <= $rand){ diff --git a/webapp/services/TameBattleDataService.php b/webapp/services/TameBattleDataService.php index 1209525f..27067e2a 100644 --- a/webapp/services/TameBattleDataService.php +++ b/webapp/services/TameBattleDataService.php @@ -720,6 +720,7 @@ class TameBattleDataService extends BaseService { 'pve_boss_killed'=> getXVal($info,'pve_boss_killed', 0), 'hero_lv'=> getXVal($info,'hero_lv', 1), 'dead_times'=> getXVal($info,'dead_times', 0), + 'box_num'=> getXVal($info,'box_num', 0), 'battle_score'=> 0, 'reward' => $rewards, 'winningPro' => $winningPro, From eab6f457a139dd0af01fcfb3d3c0f57fb63184a3 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 31 Jul 2024 16:41:31 +0800 Subject: [PATCH 3/6] 1 --- doc/BlockChain.py | 23 +------------------ .../controller/BlockChainController.class.php | 2 +- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/doc/BlockChain.py b/doc/BlockChain.py index e8b40e55..a5743870 100644 --- a/doc/BlockChain.py +++ b/doc/BlockChain.py @@ -121,26 +121,5 @@ class BlockChain(object): ['order_id', '', '订单id'], ['!params', [''], '合约参数列表'], ] - }, - { - 'name': 'rechargeBuyS', - 'desc': 'usdt钻石充值', - 'group': 'BlockChain', - 'surl': 'webapp/index.php?c=BlockChain&a=rechargeBuyS', - 'params': [ - _common.ReqHead(), - ['goods_id', '', '商品id'], - ], - 'response': [ - _common.RspHead(), - ['order_id', '', '订单id'], - ['!calls', - [ - ['trans_id', '', '事务id'], - ['trans_req', _common.MFTransactionRequest(), '调用合约参数'], - ], - '合约调用-队列(排队执行上一个成功才能调用下一个)' - ] - ] - }, + } ] diff --git a/webapp/controller/BlockChainController.class.php b/webapp/controller/BlockChainController.class.php index dcb36637..4184a5db 100644 --- a/webapp/controller/BlockChainController.class.php +++ b/webapp/controller/BlockChainController.class.php @@ -457,7 +457,7 @@ class BlockChainController extends BaseAuthedController { )); } - public function rechargeBuyS() + private function rechargeBuyS() { $goodsMeta = mt\Recharge::get(getReqVal('goods_id', '')); if (!$goodsMeta) { From 57c79654683a50f5d60edc19c9aaea16d7340716 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 31 Jul 2024 16:45:01 +0800 Subject: [PATCH 4/6] 1 --- sql/bcnftdb.sql | 24 ++++++++++++++++++++++++ sql/gamedb.sql | 25 ------------------------- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/sql/bcnftdb.sql b/sql/bcnftdb.sql index 8f70a828..8ad37293 100644 --- a/sql/bcnftdb.sql +++ b/sql/bcnftdb.sql @@ -310,4 +310,28 @@ CREATE TABLE `t_contribution` ( ) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `t_recharge_order` +-- + +DROP TABLE IF EXISTS `t_recharge_order`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_recharge_order` ( + `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', + `order_id` varchar(255) COMMENT '订单号', + `account_address` varchar(60) NOT NULL COMMENT '钱包地址', + `currency_address` varchar(60) NOT NULL DEFAULT '' COMMENT '货币地址', + `currency_name` varchar(60) NOT NULL DEFAULT '' COMMENT '货币名称', + `status` int(11) NOT NULL DEFAULT '0' COMMENT '0: 支付中 1: 已发货', + `item_id` int(11) NOT NULL COMMENT '道具id', + `item_num` bigint NOT NULL DEFAULT '0' COMMENT '道具数量', + `price` varchar(60) COLLATE utf8_bin NOT NULL COMMENT '价格', + `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `order_id` (`order_id`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; + -- Dump completed on 2015-08-19 18:51:22 diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 2f143928..fd36c6b3 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -1909,31 +1909,6 @@ CREATE TABLE `t_server_task_battle_count` ( ) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*!40101 SET character_set_client = @saved_cs_client */; --- --- Table structure for table `t_recharge_order` --- - -DROP TABLE IF EXISTS `t_recharge_order`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `t_recharge_order` ( - `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', - `order_id` varchar(255) COMMENT '订单号', - `account_id` varchar(60) NOT NULL COMMENT '账号id', - `account_address` varchar(60) NOT NULL COMMENT '钱包地址', - `currency_address` varchar(60) NOT NULL DEFAULT '' COMMENT '货币地址', - `currency_name` varchar(60) NOT NULL DEFAULT '' COMMENT '货币名称', - `status` int(11) NOT NULL DEFAULT '0' COMMENT '0: 支付中 1: 已发货', - `item_id` int(11) NOT NULL COMMENT '道具id', - `item_num` bigint NOT NULL DEFAULT '0' COMMENT '道具数量', - `price` varchar(60) COLLATE utf8_bin NOT NULL COMMENT '价格', - `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', - `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', - PRIMARY KEY (`idx`), - UNIQUE KEY `order_id` (`order_id`) -) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -/*!40101 SET character_set_client = @saved_cs_client */; - -- -- Table structure for table `t_switch` -- From cdcde709dc0c9f9ce7cb2957df9bff0b0a954a5b Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 31 Jul 2024 17:07:10 +0800 Subject: [PATCH 5/6] 1 --- doc/AAMarket.py | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ doc/_common.py | 16 +++++++++++++- 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/doc/AAMarket.py b/doc/AAMarket.py index 79f3ad0e..db2f4b42 100644 --- a/doc/AAMarket.py +++ b/doc/AAMarket.py @@ -377,4 +377,59 @@ class AAMarket(object): ['!rows', [_common.ChainActivity()], '数据'], ] }, + { + 'method': 'GET', + 'name': '/api/recharge/goods', + 'desc': '充值-商品列表', + 'group': '!AAMarket', + 'url': 'https://market-test.kingsome.cn/api/recharge/goods', + 'is_json_params': False, + 'request_params': [ + ], + 'params': [ + ], + 'response': [ + _common.RspHead(), + ['!rows', [_common.RechargeGoods()], '数据'], + ] + }, + { + 'method': 'POST', + 'name': '/api/recharge/buy', + 'desc': '充值-购买', + 'group': '!AAMarket', + 'url': 'https://market-test.kingsome.cn/api/recharge/buy', + 'headers': _common.JwtHeader, + 'is_json_params': True, + 'request_params': [ + ], + 'params': [ + ['net_id', 0, '链id'], + ['goods_id', '', '商品id'], + ['account_address', '', '钱包地址(一般为小狐狸)'], + ], + 'response': [ + _common.RspHead(), + ['calls', _common.NftTransaction(), '合约调用'] + ] + }, + { + 'method': 'POST', + 'name': '/api/recharge/history', + 'desc': '充值-历史', + 'group': '!AAMarket', + 'url': 'https://market-test.kingsome.cn/api/recharge/history', + 'headers': _common.JwtHeader, + 'is_json_params': True, + 'request_params': [ + ], + 'params': [ + ['net_id', 0, '链id'], + ], + 'response': [ + _common.RspHead(), + ['page', _common.StreamPage(), '分页信息'], + ['!rows', [_common.RechargeHistory()], '数据'], + ] + }, ] diff --git a/doc/_common.py b/doc/_common.py index dfcdcee8..68dda865 100644 --- a/doc/_common.py +++ b/doc/_common.py @@ -1828,5 +1828,19 @@ class RechargeGoods(object): def __init__(self): self.fields = [ ['goods_id', '', '商品id(购买时用)'], - ['goods_meta', '', '配置表信息(和excel完全一样)'], + ['diamond', 0, '充值所得钻石'], + ['currency', '', '货币地址'], + ['price', '', '价格'], + ] + +class RechargeHistory(object): + + def __init__(self): + self.fields = [ + ['order_id', '', '订单id'], + ['txhash', '', 'txhash'], + ['net_id', 0, '链id'], + ['currency', '', '货币地址'], + ['amount', '', '货币数'], + ['createtime', 0, '成交时间'], ] From 1992f163434a55407dbed4f95da771c3fcc39aaf Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 31 Jul 2024 17:11:11 +0800 Subject: [PATCH 6/6] 1 --- doc/AAMarket.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/AAMarket.py b/doc/AAMarket.py index db2f4b42..de0fd897 100644 --- a/doc/AAMarket.py +++ b/doc/AAMarket.py @@ -410,7 +410,10 @@ class AAMarket(object): ], 'response': [ _common.RspHead(), - ['calls', _common.NftTransaction(), '合约调用'] + ['!calls', [ + ['trans_id', '', '事务id'], + ['trans_req', _common.MFTransactionRequest(), '调用合约参数'], + ], '合约调用'] ] }, {