UPDATE extension_center_statistic s SET s.today_register_num = (SELECT COUNT(id) FROM consumer_info i WHERE i.salesman_id = s.salesman_id AND FROM_UNIXTIME(i.created_at/1000,'%Y-%m-%d') = s.time GROUP BY i.salesman_id,FROM_UNIXTIME(i.created_at/1000,'%Y-%m-%d')),s.today_deal_num = (SELECT COUNT(id) FROM vorder v WHERE v.pay_price > 0 AND v.pay_time > 0 AND  v.salesman_id = s.salesman_id AND FROM_UNIXTIME(v.created_at/1000,'%Y-%m-%d') = s.time GROUP BY v.salesman_id,FROM_UNIXTIME(v.created_at/1000,'%Y-%m-%d')),s.today_deal_amount = (SELECT SUM(pay_price) FROM vorder v WHERE v.pay_price > 0 AND v.pay_time > 0 AND  v.salesman_id = s.salesman_id AND FROM_UNIXTIME(v.created_at/1000,'%Y-%m-%d') = s.time GROUP BY v.salesman_id,FROM_UNIXTIME(v.created_at/1000,'%Y-%m-%d'));
UPDATE extension_center_statistic s SET s.today_deal_num = 0 WHERE s.today_deal_num IS NULL;
UPDATE extension_center_statistic s SET s.today_register_num = 0 WHERE s.today_register_num IS NULL;
UPDATE extension_center_statistic s SET s.today_deal_amount = 0 WHERE s.today_deal_amount IS NULL;



 -- 新增接口权限
INSERT INTO `function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES (248, '推广注册记录明细', '(/admin/web/promoters/).*(/register)', 'GET', 1, 0);
INSERT INTO `function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES (249, '推广浏览记录明细', '(/admin/web/promoters/).*(/visitors)', 'GET', 1, 0);
INSERT INTO `function_permission` (`id`, `name`, `url`, `method`, `create_time`, `del_flag`) VALUES (250, '推广员最近10天推广浏览、注册、下单数据', '(/admin/web/promoters/).*(/near_statistics)', 'GET', 1, 0);

 -- 新增菜单并绑定接口权限
UPDATE `permission_info` SET `fids`='237,238,239,240,241,244,245,246,248,249,250' WHERE id = 87;

