diff --git a/Application/Admin/Controller/PayChannelController.class.php b/Application/Admin/Controller/PayChannelController.class.php index 873cf24a0..c913d60f3 100644 --- a/Application/Admin/Controller/PayChannelController.class.php +++ b/Application/Admin/Controller/PayChannelController.class.php @@ -58,7 +58,7 @@ class PayChannelController extends ThinkController // setPowerPromoteIds($map,'promote_id'); //游戏币计算 - $data = M('spend','tab_') + $data = M('spend use index(pay_channel)','tab_') ->field("game_name,sum(pay_amount) as pay_amount,game_id") ->where($map) ->group('game_id') @@ -138,6 +138,7 @@ class PayChannelController extends ThinkController ->join("inner join tab_test_white_list on tab_game_supersign.user_id=tab_test_white_list.user_id") ->where($superMap) ->sum('pay_price'); + $superSignData['test_coin'] = $testSuperSignCost?$testSuperSignCost:0; $superSignData['sum'] = $superSignData['pay_amount']?$superSignData['pay_amount']:0; $superSignData['pay_amount'] = $superSignData['pay_amount'] - $superSignData['test_coin']; @@ -189,6 +190,7 @@ class PayChannelController extends ThinkController $this->assign('spreadData',$spreadData); $channelData = $this->getPayChannel($map); + $testOrderChannelDatas = $this->getTestOrderPayChannel($maptestorder); $payTypeData['支付宝支付金额'] = 0; $payTypeData['微信支付金额'] = 0; @@ -405,7 +407,7 @@ class PayChannelController extends ThinkController public function getPayChannel($map) { //支付 //游戏订单渠道 - $channelData = M('spend','tab_') + $channelData = M('spend use index(pay_channel_type)','tab_') ->field('sum(pay_amount) as pay_amount,pay_way') ->where($map) ->group('pay_way') diff --git a/Data/update.sql b/Data/update.sql index 59404fe23..2bbb56f06 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1439,4 +1439,10 @@ CREATE TABLE `tab_promote_game_available_balance` ( `server_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '区服名称', `available_balance` int(11) NOT NULL DEFAULT 0 COMMENT '可用余额', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic; \ No newline at end of file +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic; + +-- 2020-03-05 zyx spend添加索引 +ALTER TABLE `tab_spend` +DROP INDEX `pay_channel_type`, +ADD INDEX `pay_channel`(`pay_way`, `pay_status`, `game_id`) USING BTREE, +ADD INDEX `pay_channel_type`(`pay_status`, `pay_way`) USING BTREE; \ No newline at end of file