links('agent'); $GG=$db->getpost($GG,"id|num,yk|num"); if($GG['submit']){ if($GG['pass']==$CONFIG['ADMIN']['pass']){ $save = [ "Accounts"=>$GG['idname'], "WeiXin"=>$GG['weixin'], "LeftCount"=>$GG['yk'], "PayMoney"=>$GG['je'] ]; $db->update('AgentList',$save,"ID='".$GG['id']."'"); $ppxq -> assign('Edit_Ok',"修改成功!"); }else{ $ppxq -> assign('Edit_Error',"操作密码错误!"); } } $info = $db->fetch_one("select *,convert(char,LastLogonDate,120) as Date from AgentList where ID='".$GG['id']."'"); //代理充值记录 $data = $db->fetch_all("select top 20 a.*,convert(char,a.OperDate,120) as Date,b.Accounts,b.WeiXin from AgentDealLog as a LEFT JOIN AgentList as b ON(a.AgentID=b.ID) where a.ToKind='1' and a.AgentID='1' and a.Del='0' and a.ToID='".$GG['id']."' order by ID desc"); if($data){ foreach($data as $k=>$v){ $datas[$k] = $v; $datas[$k]['OperCount'] = abs($v['OperCount']); } } //代理销售记录 $log = $db->fetch_all("select top 20 a.*,convert(char,a.OperDate,120) as Date,b.GameID,b.NickName from AgentDealLog as a LEFT JOIN QPAccountsDB.dbo.AccountsInfo as b ON(a.ToID=b.UserID) where a.ToKind='0' and a.AgentID='".$GG['id']."' order by ID desc"); $ppxq -> register_function('timename','timename'); $ppxq -> register_function('convertip','convertip'); $ppxq -> assign('toux', $info['HeadHttp'] ? $info['HeadHttp'] : '/m/img/toux.jpg'); $ppxq -> assign('info',$info); $ppxq -> assign('data',$datas); $ppxq -> assign('log',$log); $ppxq -> assign('GG',$GG); $ppxq -> display('user/agent-add.tpl'); $db->close(); unset($GG,$ppxq,$db); ?>