|
为了不扰乱会员对源码的测试,有问题咨询右侧客服不要直接回复,否则视为非法信息屏蔽会员ID! 执行的SQL语句出错:
CREATE DEFINER=`root`@`localhost` PROCEDURE `addBet`(_uid int, _amount float, _username varchar(16) character set utf8)
begin
declare parentId1 int;
declare parentId2 int;
declare pname varchar(16) character set utf8;
declare CommissionBase float(10,2);
declare CommissionParentAmount float(10,2);
declare CommissionParentAmount2 float(10,2);
declare cur Decimal(12,4);
declare _commisioned tinyint(1);
select bet into cur from ssc_member_bet where uid=_uid and date=date_format(now(),'%Y%m%d');
if cur is null THEN
INSERT into ssc_member_bet(uid, username, date, bet, commisioned) values(_uid, _username, date_format(now(),'%Y%m%d'), _amount, 0);
end if;
if cur is not null THEN
update ssc_member_bet set bet=bet+_amount where uid=_uid and date=date_format(now(),'%Y%m%d');
end if;
select bet into cur from ssc_member_bet where uid=_uid and date=date_format(now(),'%Y%m%d');
select commisioned into _commisioned from ssc_member_bet where uid=_uid and date=date_format(now(),'%Y%m%d');
select `value` into CommissionBase from ssc_params where name='conCommissionBase' limit 1;
if cur >= CommissionBase and _commisioned=0 then
select `value` into CommissionParentAmount from ssc_params where name='conCommissionParentAmount' limit 1;
select `value` into CommissionParentAmount2 from ssc_params where name='conCommissionParentAmount2' limit 1;
select `parentId` into parentId1 from ssc_members where uid=_uid;
if parentId1 is not null and CommissionParentAmount>0 THEN
call setCoin(CommissionParentAmount, 0, parentId1, 53, 0, concat('[', _username, ']消费佣金'), 0, '', '');
select `parentId` into parentId2 from ssc_members where uid=parentId1;
if parentId2 is not null and CommissionParentAmount2>0 THEN
select `username` into pname from ssc_members where uid=parentId1;
call setCoin(CommissionParentAmount2, 0, parentId2, 53, 0, concat('[', pname,'->', _username, ']消费佣金'), 0, '', '');
end if;
update ssc_member_bet set commisioned=1 where uid=_uid and date=date_format(now(),'%Y%m%d');
end if;
end if;
end
错误信息:Access denied; you need the SUPER privilege for this operation |
|