源码论坛公告:本站是一个交流学习建站资源的社区论坛,旨在交流学习源码脚本等资源技术,欢迎大家投稿发言! 【点击此处将锦尚放在桌面

源码论坛,商业源码下载,尽在锦尚中国商业源码论坛

 找回密码
 会员注册

QQ登录

只需一步,快速开始

楼主: 洪七公
打印 上一主题 下一主题

[常见问题] 【新手必读】微信魔方 微赞等系统源码模块安装问题汇总

  [复制链接]

0

主题

9

帖子

903

金币

初级会员

Rank: 1

积分
1854
QQ
1#
发表于 2017-5-11 11:01:40 | 显示全部楼层
为了不扰乱会员对源码的测试,有问题咨询右侧客服不要直接回复,否则视为非法信息屏蔽会员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
您需要登录后才可以回帖 登录 | 会员注册

本版积分规则

锦尚中国源码论坛

聚合标签|锦尚中国,为中国网站设计添动力 ( 鲁ICP备09033200号 ) |网站地图

GMT+8, 2024-5-8 17:11 , Processed in 0.028425 second(s), 15 queries .

带宽由 锦尚数据 提供 专业的数据中心

© 锦尚中国源码论坛 52jscn Inc. 非法入侵必将受到法律制裁 法律顾问:IT法律网 & 褚福省律师 锦尚爱心 版权申诉 版权与免责声明