支付渠道添加索引

master
zhengyongxing 5 years ago
parent f980de770e
commit 141bdf561a

@ -58,7 +58,7 @@ class PayChannelController extends ThinkController
// setPowerPromoteIds($map,'promote_id'); // 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") ->field("game_name,sum(pay_amount) as pay_amount,game_id")
->where($map) ->where($map)
->group('game_id') ->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") ->join("inner join tab_test_white_list on tab_game_supersign.user_id=tab_test_white_list.user_id")
->where($superMap) ->where($superMap)
->sum('pay_price'); ->sum('pay_price');
$superSignData['test_coin'] = $testSuperSignCost?$testSuperSignCost:0; $superSignData['test_coin'] = $testSuperSignCost?$testSuperSignCost:0;
$superSignData['sum'] = $superSignData['pay_amount']?$superSignData['pay_amount']:0; $superSignData['sum'] = $superSignData['pay_amount']?$superSignData['pay_amount']:0;
$superSignData['pay_amount'] = $superSignData['pay_amount'] - $superSignData['test_coin']; $superSignData['pay_amount'] = $superSignData['pay_amount'] - $superSignData['test_coin'];
@ -189,6 +190,7 @@ class PayChannelController extends ThinkController
$this->assign('spreadData',$spreadData); $this->assign('spreadData',$spreadData);
$channelData = $this->getPayChannel($map); $channelData = $this->getPayChannel($map);
$testOrderChannelDatas = $this->getTestOrderPayChannel($maptestorder); $testOrderChannelDatas = $this->getTestOrderPayChannel($maptestorder);
$payTypeData['支付宝支付金额'] = 0; $payTypeData['支付宝支付金额'] = 0;
$payTypeData['微信支付金额'] = 0; $payTypeData['微信支付金额'] = 0;
@ -405,7 +407,7 @@ class PayChannelController extends ThinkController
public function getPayChannel($map) { 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') ->field('sum(pay_amount) as pay_amount,pay_way')
->where($map) ->where($map)
->group('pay_way') ->group('pay_way')

@ -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 '区服名称', `server_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '区服名称',
`available_balance` int(11) NOT NULL DEFAULT 0 COMMENT '可用余额', `available_balance` int(11) NOT NULL DEFAULT 0 COMMENT '可用余额',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic; ) 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;
Loading…
Cancel
Save