MODIFY COLUMN `free_balance` decimal(20, 6) UNSIGNED NOT NULL DEFAULT 0 COMMENT '可用余额' AFTER `pay_freeze`,
MODIFY COLUMN `income_balance` decimal(20, 6) UNSIGNED NOT NULL DEFAULT 0 COMMENT '账户收入总额' AFTER `free_balance`,
MODIFY COLUMN `recharge_income` decimal(20, 6) UNSIGNED NOT NULL DEFAULT 0 COMMENT '在线充值收入' AFTER `income_balance`,
MODIFY COLUMN `opencard_income` decimal(20, 6) UNSIGNED NOT NULL DEFAULT 0 COMMENT '账户开卡收入' AFTER `recharge_income`,
MODIFY COLUMN `withdraw_balance` decimal(20, 6) UNSIGNED NOT NULL DEFAULT 0 COMMENT '提现总额' AFTER `deleted_at`,
MODIFY COLUMN `consume_balance` decimal(20, 6) UNSIGNED NOT NULL DEFAULT 0 COMMENT '消费总额' AFTER `withdraw_balance`;
UPDATE agent_reward a
JOIN user_agent b ON a.agent_id=b.agent_id
SET a.agent_level=b.agent_level
WHERE a.recharge_time BETWEEN '2019-06-01 00:00:00' and '2019-06-30 23:59:59'
AND a.agent_level=0;
测试
select * from agent_salary where agent_id=29 and yeartime=2019 and monthtime=6;
select * from agent_account_log where agent_id=29;
select * from agent_reward where agent_id=29 and recharge_time BETWEEN '2019-06-01 00:00:00' and '2019-06-30 23:59:59';
select * from agent_income_summary where agent_id=29 and yeartime=2019 and monthtime=6;
delete from agent_salary where agent_id=29 and yeartime=2019 and monthtime=6;
delete from agent_account_log where agent_id=29;
update agent_reward set reward_status=100,settle_state=case when settle_state=300 then 200 else settle_state end where agent_id=29 and recharge_time BETWEEN '2019-06-01 00:00:00' and '2019-06-30 23:59:59' ;
delete from agent_income_summary where agent_id=29 and yeartime=2019 and monthtime=6;
select * from partner_account_log where user_id=89 order by id desc;
select * from partner_reward where user_id=89 and recharge_time BETWEEN '2019-06-01 00:00:00' and '2019-06-30 23:59:59';
select * from partner_income_summary where user_id=89 and yeartime=2019 and monthtime=6;
delete from partner_account_log where user_id=89 and yeartime=2019 and monthtime=6;
update partner_reward set reward_status=100,settle_state=case when settle_state=300 then 200 else settle_state end where user_id=89 and recharge_time BETWEEN '2019-06-01 00:00:00' and '2019-06-30 23:59:59' ;
delete from partner_income_summary where user_id=89 and yeartime=2019 and monthtime=6;