工会web
This commit is contained in:
91
GonghuiWeb/www/adminxx/user/weihu-c.php
Normal file
91
GonghuiWeb/www/adminxx/user/weihu-c.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
include_once("../../../inc/admin.inc.php");
|
||||
include_once("../../../inc/class.php");
|
||||
include_once("../../../inc/admin.smarty.php");
|
||||
include_once("../../../inc/admin.power.php");
|
||||
if($GG['js']){
|
||||
function day_gold($userid,$date,$gold,$db){
|
||||
$day = $db->fetch_one("select * from CountUserJf where UserID='".$userid."' and Days='".date('Y-m-d',strtotime($date))."'");
|
||||
if($day){
|
||||
$db->update('CountUserJf',['Gold' => $day['Gold']+$gold],"CujID='".$day['CujID']."'");
|
||||
}else{
|
||||
$db->insert("CountUserJf",['Gold' => $gold]);
|
||||
}
|
||||
}
|
||||
function month_gold($userid,$date,$gold,$db){
|
||||
$month = $db->fetch_one("select * from CountJf where UserID='".$userid."' and Month='".date('Y-m',strtotime($date))."'");
|
||||
if($month){
|
||||
$db->update('CountJf',['Gold' => $month['Gold']+$gold],"CjID='".$month['CjID']."'");
|
||||
}else{
|
||||
$db->insert("CountJf",['Gold' => $gold]);
|
||||
}
|
||||
}
|
||||
$data = $db->fetch_all("select top 30 *,convert(char,InsertTime,120) as Date from QPTreasureDB.dbo.GameUnionConsumer where GameOK='8' and GameGold>'0' and Bj='1' order by UnionConsumerID asc");
|
||||
if($data){
|
||||
$zhit = 0;
|
||||
foreach($data as $k => $v){
|
||||
//记录日数据
|
||||
$is_cday = $db->fetch_one("select * from QPTreasureDB.dbo.GameUnionDay where UnionID='".$v['UnionID']."' and UnionDay='".date('Y-m-d',strtotime($v['Date']))."'");
|
||||
if($is_cday){
|
||||
$day_gold = $is_cday['FGold'];
|
||||
}else{
|
||||
$day_gold = 0;
|
||||
}
|
||||
$day_save = [
|
||||
'FGold' => $day_gold+$v['GameGold']
|
||||
];
|
||||
$db->update('QPTreasureDB.dbo.GameUnionDay',$day_save,"UnionDayID='".$is_cday['UnionDayID']."'");
|
||||
|
||||
//记录月数据
|
||||
$is_cmonth = $db->fetch_one("select * from QPTreasureDB.dbo.GameUnionMonth where UnionID='".$v['UnionID']."' and UnionMonth='".date('Y-m',strtotime($v['Date']))."'");
|
||||
if($is_cmonth){
|
||||
$month_gold = $is_cmonth['FGold'];
|
||||
}else{
|
||||
$month_gold = 0;
|
||||
}
|
||||
$month_save = [
|
||||
'FGold'=>$month_gold+$v['GameGold']
|
||||
];
|
||||
$db->update('QPTreasureDB.dbo.GameUnionMonth',$month_save,"UnionMonthID='".$is_cmonth['UnionMonthID']."'");
|
||||
|
||||
//会员日月报表
|
||||
if($v['UserIDa'] && $v['Golda']){
|
||||
day_gold($v['UserIDa'],$v['Date'],$v['Golda'],$db);
|
||||
month_gold($v['UserIDa'],$v['Date'],$v['Golda'],$db);
|
||||
}
|
||||
if($v['UserIDb'] && $v['Goldb']){
|
||||
day_gold($v['UserIDb'],$v['Date'],$v['Goldb'],$db);
|
||||
month_gold($v['UserIDb'],$v['Date'],$v['Goldb'],$db);
|
||||
}
|
||||
if($v['UserIDc'] && $v['Goldc']){
|
||||
day_gold($v['UserIDc'],$v['Date'],$v['Goldc'],$db);
|
||||
month_gold($v['UserIDc'],$v['Date'],$v['Goldc'],$db);
|
||||
}
|
||||
if($v['UserIDd'] && $v['Goldd']){
|
||||
day_gold($v['UserIDd'],$v['Date'],$v['Goldd'],$db);
|
||||
month_gold($v['UserIDd'],$v['Date'],$v['Goldd'],$db);
|
||||
}
|
||||
if($v['UserIDe'] && $v['Golde']){
|
||||
day_gold($v['UserIDe'],$v['Date'],$v['Golde'],$db);
|
||||
month_gold($v['UserIDe'],$v['Date'],$v['Golde'],$db);
|
||||
}
|
||||
|
||||
//修改标记
|
||||
$db->update('QPTreasureDB.dbo.GameUnionConsumer',['Bj'=>2],"UnionConsumerID='".$v['UnionConsumerID']."'");
|
||||
|
||||
$zhit++;
|
||||
echo $zhit."、".$v['UnionID']." KindID:".$v['KindID']." (".$v['GameGold'].") <br>";
|
||||
}
|
||||
}
|
||||
$db->deldate("QPTreasureDB.dbo.GameUnionConsumer","GameOK='0'");
|
||||
$delday = date('Y-m-d H:i:s',time()-86400*5);
|
||||
$db->deldate("QPTreasureDB.dbo.PrivateGameRecord","convert(varchar(19),InsertTime,120) < '".$delday."'");
|
||||
$db->deldate("QPTreasureDB.dbo.PrivateGameRecordChild","convert(varchar(19),InsertTime,120) < '".$delday."'");
|
||||
$db->deldate("QPTreasureDB.dbo.PrivateGameRecordUserRecordID","convert(varchar(19),InsertTime,120) < '".$delday."'");
|
||||
$ssday = date('Y-m-d',strtotime("-2 day"));
|
||||
$db->update('QPTreasureDB.dbo.GameUnionConsumer',['GameOK'=>'8'],"GameOK='2' and convert(char(10),InsertTime,120)<'".$ssday."'");
|
||||
echo "删除公会开房失败数据<br>删除游戏5天外的记录<br>删除2天内游戏中";
|
||||
}
|
||||
$db->close();
|
||||
unset($GG,$ppxq,$db);
|
||||
?>
|
||||
Reference in New Issue
Block a user