支付渠道添加索引

master
zhengyongxing 5 years ago
parent f980de770e
commit 141bdf561a

@ -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')

@ -1440,3 +1440,9 @@ CREATE TABLE `tab_promote_game_available_balance` (
`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;
-- 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