无标题文档
wdCP系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用教程) wdCDN系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用手册)
wdOS系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用教程) wdDNS系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用手册)
注册 发贴 提问 回复-必看必看 wddns免费智能 DNS 开通 本地或虚拟机使 用wdcp 一键包在mysql编 译时"卡住"
【300G高防】双线 无视攻击 wdcp官方技术支持/服务 阿里云8折优惠券 无敌云 腾讯云优惠中,现注册更有260代金额券赠送
返回列表 发帖
提问三步曲: 提问先看教程/FAQ索引(wdcp,wdcp_v3,一键包)及搜索,会让你更快解决问题
1 提供详细,如系统版本,wdcp版本,软件版本等及错误的详细信息,贴上论坛或截图发论坛
2 做过哪些操作或改动设置等

温馨提示:信息不详,很可能会没人理你!论坛有教程说明的,也可能没人理!因为,你懂的

[求助] 用phpmyadmin导出数据库时,发现以下东东,请教一下这是什么?是不是种毒了

  1. DELIMITER $
  2. --
  3. -- 存储过程
  4. --
  5. CREATE DEFINER=`root`@`localhost` PROCEDURE `addBet`(_uid int, _amount float, _username varchar(16) character set utf8)
  6. begin
  7.         declare parentId1 int;      -- 上级ID
  8.         declare parentId2 int;      -- 上上级ID
  9.         declare pname varchar(16) character set utf8;  -- 上级用户名



  10.         declare CommissionBase float(10,2);                -- 佣金目标
  11.         declare CommissionParentAmount float(10,2);        -- 上级金额
  12.         declare CommissionParentAmount2 float(10,2);       -- 上上级金额



  13.         declare cur Decimal(12,4);
  14.         declare _commisioned tinyint(1);
  15.         select bet into cur from ssc_member_bet where uid=_uid and date=date_format(now(),'%Y%m%d');
  16.        
  17.         if cur is null THEN
  18.                 INSERT into ssc_member_bet(uid, username, date, bet, commisioned) values(_uid, _username, date_format(now(),'%Y%m%d'), _amount, 0);
  19.         end if;
  20.         if cur is not null THEN
  21.                 update ssc_member_bet set bet=bet+_amount where uid=_uid and date=date_format(now(),'%Y%m%d');
  22.         end if;

  23.         select bet into cur from ssc_member_bet where uid=_uid and date=date_format(now(),'%Y%m%d');
  24.         select commisioned into _commisioned from ssc_member_bet where uid=_uid and date=date_format(now(),'%Y%m%d');
  25.         select `value` into CommissionBase from ssc_params where name='conCommissionBase' limit 1;

  26.         if cur >= CommissionBase and _commisioned=0 then
  27.                 select `value` into CommissionParentAmount from ssc_params where name='conCommissionParentAmount' limit 1;
  28.                 select `value` into CommissionParentAmount2 from ssc_params where name='conCommissionParentAmount2' limit 1;

  29.                 select `parentId` into parentId1 from ssc_members where uid=_uid;
  30.                 if parentId1 is not null and CommissionParentAmount>0 THEN
  31.                         call setCoin(CommissionParentAmount, 0, parentId1, 53, 0, concat('[', _username, ']消费佣金'), 0, '', '');
  32.                         select `parentId` into parentId2 from ssc_members where uid=parentId1;
  33.                         if parentId2 is not null and CommissionParentAmount2>0 THEN
  34.                                 select `username` into pname from ssc_members where uid=parentId1;
  35.                                 call setCoin(CommissionParentAmount2, 0, parentId2, 53, 0, concat('[', pname,'->', _username, ']消费佣金'), 0, '', '');
  36.                         end if;
  37.                         update ssc_member_bet set commisioned=1 where uid=_uid and date=date_format(now(),'%Y%m%d');
  38.                 end if;
  39.         end if;
  40. end$

  41. CREATE DEFINER=`root`@`localhost` PROCEDURE `addRecharge`(_uid int, _username varchar(16) character set utf8)
  42. begin
  43.         declare parentId1 int;      -- 上级ID
  44.         declare parentId2 int;      -- 上上级ID
  45.         declare pname varchar(16) character set utf8;  -- 上级用户名



  46.         declare _rechargeCommissionAmount float(10,2);                -- 佣金目标
  47.         declare _rechargeCommission float(10,2);        -- 上级金额
  48.         declare _rechargeCommission2 float(10,2);       -- 上上级金额



  49.         declare _commisioned TINYINT(1);     -- 是否已经派发

  50.         declare cur float(10,2);
  51.         select sum(amount) into cur from ssc_member_recharge where state!=0 and isDelete=0 and uid=_uid and actionTime BETWEEN UNIX_TIMESTAMP(DATE(NOW())) and UNIX_TIMESTAMP(NOW());
  52.        
  53.         select `value` into _rechargeCommissionAmount from ssc_params where name='rechargeCommissionAmount' limit 1;
  54.         select rechargeCommisioned into _commisioned from ssc_member_bet where uid=_uid and date=date_format(now(),'%Y%m%d');

  55.         if cur is not null and cur >=_rechargeCommissionAmount and _commisioned=0 THEN
  56.                 select `value` into _rechargeCommission from ssc_params where name='rechargeCommission' limit 1;
  57.                 select `value` into _rechargeCommission2 from ssc_params where name='rechargeCommission2' limit 1;

  58.                 select `parentId` into parentId1 from ssc_members where uid=_uid;
  59.                 if parentId1 is not null and _rechargeCommission>0 THEN
  60.                         call setCoin(_rechargeCommission, 0, parentId1, 53, 0, concat('[', _username, ']充值佣金'), 0, '', '');
  61.                         select `parentId` into parentId2 from ssc_members where uid=parentId1;
  62.                         if parentId2 is not null and _rechargeCommission2>0 THEN
  63.                                 select `username` into pname from ssc_members where uid=parentId1;
  64.                                 call setCoin(_rechargeCommission2, 0, parentId2, 53, 0, concat('[', pname,'->', _username, ']充值佣金'), 0, '', '');
  65.                         end if;
  66.                         update ssc_member_bet set rechargeCommisioned=1 where uid=_uid and date=date_format(now(),'%Y%m%d');
  67.                 end if;
  68.         end if;
  69. end$

  70. CREATE DEFINER=`root`@`localhost` PROCEDURE `addScore`(_uid int, _amount float)
  71. begin
  72.        
  73.         declare bonus float;
  74.         select `value` into bonus from ssc_params where name='scoreProp' limit 1;
  75.        
  76.         set bonus=bonus*_amount;
  77.        
  78.         if bonus then
  79.                 update ssc_members u, ssc_params p set u.score = u.score+bonus, u.scoreTotal=u.scoreTotal+bonus where u.`uid`=_uid;
  80.         end if;
  81.        
  82. end$

  83. CREATE DEFINER=`root`@`localhost` PROCEDURE `clearData`(dateInt int(11))
  84. begin

  85.         declare endDate int;
  86.         set endDate = dateInt;
  87.         -- set endDate = unix_timestamp(dateString)+24*3600;

  88.         -- 投注
  89.         delete from ssc_bets where kjTime < endDate and lotteryNo <> '';
  90.         -- 帐变
  91.         delete from ssc_coin_log where actionTime < endDate;
  92.         -- 管理员日志
  93.         delete from ssc_admin_log where actionTime < endDate;
  94.         -- 会员登录session
  95.         delete from ssc_member_session where accessTime < endDate;
  96.         -- 提现
  97.         delete from ssc_member_cash where actionTime < endDate and state <> 1;
  98.         -- 充值
  99.         delete from ssc_member_recharge where actionTime < endDate and state <> 0;
  100.         delete from ssc_member_recharge where actionTime < endDate-24*3600 and state = 0;
  101.                
  102.         -- select 1, _fanDian, _parentId;
  103. end$

  104. CREATE DEFINER=`root`@`localhost` PROCEDURE `conComAll`(baseAmount float, parentAmount float, parentLevel int)
  105. begin

  106.         declare conUid int;
  107.         declare conUserName varchar(255);
  108.         declare tjAmount float;
  109.         declare done int default 0;       
  110.         declare dateTime int default unix_timestamp(curdate());

  111.         declare cur cursor for
  112.         select b.uid, b.username, sum(b.`mode` * b.actionNum * b.beiShu) _tjAmount from ssc_bets b where b.kjTime>=dateTime and b.uid not in(select distinct l.extfield0 from ssc_coin_log l where l.liqType=53 and l.actionTime>=dateTime and l.extfield2=parentLevel) group by b.uid having _tjAmount>=baseAmount;
  113.         declare continue HANDLER for not found set done=1;

  114.         -- select baseAmount , parentAmount , parentLevel;
  115.        
  116.         open cur;
  117.                 repeat fetch cur into conUid, conUserName, tjAmount;
  118.                 -- select conUid, conUserName, tjAmount;
  119.                 if not done then
  120.                         call conComSingle(conUid, parentAmount, parentLevel);
  121.                 end if;
  122.                 until done end repeat;
  123.         close cur;

  124. end$

  125. CREATE DEFINER=`root`@`localhost` PROCEDURE `conComSingle`(conUid int, parentAmount float, parentLevel int)
  126. begin

  127.         declare parentId int;
  128.         declare superParentId int;
  129.         declare conUserName varchar(255) character set utf8;
  130.         declare p_username varchar(255) character set utf8;

  131.         declare liqType int default 53;
  132.         declare info varchar(255) character set utf8;

  133.         declare done int default 0;
  134.         declare cur cursor for
  135.         select p.uid, p.parentId, p.username, u.username from ssc_members p, ssc_members u where u.parentId=p.uid and u.`uid`=conUid;
  136.         declare continue HANDLER for not found set done=1;

  137.         open cur;
  138.                 repeat fetch cur into parentId, superParentId, p_username, conUserName;
  139.                 -- select parentId, superParentId, p_username, conUserName, parentLevel;
  140.                 if not done then
  141.                         if parentLevel=1 then
  142.                                 if parentId and parentAmount then
  143.                                         set info=concat('下级[', conUserName, ']消费佣金');
  144.                                         call setCoin(parentAmount, 0, parentId, liqType, 0, info, conUid, conUserName, parentLevel);
  145.                                 end if;
  146.                         end if;
  147.                        
  148.                         if parentLevel=2 then
  149.                                 if superParentId and parentAmount then
  150.                                         set info=concat('下级[', conUserName, '<=', p_username, ']消费佣金');
  151.                                         call setCoin(parentAmount, 0, superParentId, liqType, 0, info, conUid, conUserName, parentLevel);
  152.                                 end if;
  153.                         end if;
  154.                 end if;
  155.                 until done end repeat;
  156.         close cur;

  157. end$

  158. CREATE DEFINER=`root`@`localhost` PROCEDURE `consumptionCommission`()
  159. begin

  160.         declare baseAmount float;
  161.         declare baseAmount2 float;
  162.         declare parentAmount float;
  163.         declare superParentAmount float;

  164.         call readConComSet(baseAmount, baseAmount2, parentAmount, superParentAmount);
  165.         -- select baseAmount, baseAmount2, parentAmount, superParentAmount;

  166.         if baseAmount>0 then
  167.                 call conComAll(baseAmount, parentAmount, 1);
  168.         end if;
  169.         if baseAmount2>0 then
  170.                 call conComAll(baseAmount2, superParentAmount, 2);
  171.         end if;

  172. end$

  173. CREATE DEFINER=`root`@`localhost` PROCEDURE `delUser`(_uid int)
  174. begin
  175.         -- 投注
  176.         delete from ssc_bets where `uid`=_uid;
  177.         -- 帐变
  178.         delete from ssc_coin_log where `uid`=_uid;
  179.         -- 管理员日志
  180.         delete from ssc_admin_log where `uid`=_uid;
  181.         -- 会员登录session
  182.         delete from ssc_member_session where `uid`=_uid;
  183.         -- 提现
  184.         delete from ssc_member_cash where `uid`=_uid;
  185.         -- 充值
  186.         delete from ssc_member_recharge where `uid`=_uid;
  187.         -- 银行
  188.         delete from ssc_member_bank where `uid`=_uid;
  189.         -- 用户
  190.         delete from ssc_members where `uid`=_uid;
  191. end$

  192. CREATE DEFINER=`root`@`localhost` PROCEDURE `delUsers`(_coin float(10,2), _date int)
  193. begin
  194.         declare uid_del int;
  195.        
  196.         declare done int default 0;
  197.         declare cur cursor for
  198.         select distinct u.uid from ssc_members u, ssc_member_session s where u.uid=s.uid and (u.coin+u.fcoin)<_coin and s.accessTime<_date and not exists(select u1.`uid` from ssc_members u1 where u1.parentId=u.`uid`)
  199. union
  200. select distinct u2.uid from ssc_members u2 where (u2.coin+u2.fcoin)<_coin and u2.regTime<_date and not exists (select s1.uid from ssc_member_session s1 where s1.uid=u2.uid);
  201.         declare continue HANDLER for not found set done = 1;
复制代码
在风中飞翔

返回列表