$rsdb[totalspace] = number_format($webdb[totalSpace] + $group_db[totalspace] + $rsdb[totalspace] / (1024 * 1024) - $rsdb[usespace], 3); if ($rsdb[sex] == 1) { $rsdb[sex] = '男'; } elseif ($rsdb[sex] == 2) { $rsdb[sex] = '女'; } else { $rsdb[sex] = '保密'; } $rsdb[lastvist] = date("Y-m-d H:i:s", $rsdb[lastvist]); $rsdb[regdate] = date("Y-m-d H:i:s", $rsdb[regdate]); $rsdb[introduce] = str_replace("\n", "<br>", $rsdb[introduce]); if ($lfjuid != $rsdb[uid] && !$web_admin) { $rsdb[regip] = $rsdb[address] = $rsdb[postalcode] = $rsdb[telephone] = $rsdb[mobphone] = $rsdb[idcard] = $rsdb[truename] = "保密"; } $rsdb[icon] = tempdir($rsdb[icon]); $rsdb[lastip] = ipfrom($rsdb[lastip]); $rsdb[postalcode] == 0 && ($rsdb[postalcode] = ''); $rsdb[lastview] = $rsdb[lastview] ? date("Y-m-d H:i", $rsdb[lastview]) : '未知'; $rsdb[hits] || ($rsdb[hits] = '未知'); //我的最新文章 $myarticleDB = ''; $query = $db->query("SELECT * FROM {$pre}article WHERE mid=0 AND uid='{$uid}' ORDER BY aid DESC LIMIT 10"); while ($rs = $db->fetch_array($query)) { $myarticleDB[] = $rs; } //我的热门文章 $myhotarticleDB = ''; $query = $db->query("SELECT * FROM {$pre}article WHERE mid=0 AND uid='{$uid}' ORDER BY hits DESC LIMIT 10"); while ($rs = $db->fetch_array($query)) { $myhotarticleDB[] = $rs; }
} } $select_group = select_group("groupid", $groupid, "index.php?lfj=member&job=list&T={$T}"); if (!$page) { $page = 1; } $rows = 20; $min = ($page - 1) * $rows; $showpage = getpage("{$pre}memberdata D", "{$SQL}", "index.php?lfj={$lfj}&job={$job}&type={$type}&T={$T}&keywords={$keywords}&groupid={$groupid}", $rows); $query = $db->query("SELECT D.* FROM {$pre}memberdata D {$SQL} ORDER BY D.uid DESC LIMIT {$min},{$rows} "); while ($rs = $db->fetch_array($query)) { $rs[lastvist] = $rs[lastvist] ? date("Y-m-d H:i:s", $rs[lastvist]) : ''; $rs[regdate] = $rs[regdate] ? date("Y-m-d H:i:s", $rs[regdate]) : ''; if (is_file(ROOT_PATH . 'inc/ip.dat')) { $rs[lastip_area] = ipfrom($rs[lastip]); $rs[regip_area] = ipfrom($rs[regip]); } if (!$rs[groupid]) { $rs[alert] = "alert('此用户的资料,还没有在整站激活,你不能进行任何操作!');return false;"; } else { $rs[alert] = ""; } if ($rs[yz]) { $rs[yz] = "<A HREF='index.php?lfj={$lfj}&action=yz&uid_db[0]={$rs['uid']}&T=noyz' style='color:red;' onclick=\"{$rs['alert']}\" title='已经通过审核,点击即可取消审核'><img src='../member/images/check_yes.gif' border='0'></A>"; } elseif ($rs[groupid]) { $rs[yz] = "<A HREF='index.php?lfj={$lfj}&action=yz&uid_db[0]={$rs['uid']}&T=yz' style='color:blue;' onclick=\"{$rs['alert']}\" title='还没有通过审核,点击即可通过审核'><img src='../member/images/check_no.gif' border='0'></A>"; } else { $rs[yz] = "未激活"; } $listdb[] = $rs; }
function testIP() { echo ipfrom("116.231.200.75"); }
public function low_bid(){ if($_POST['pay']<1){ $msg['status'] = 0; $msg['notice'] = '出价不能低于1元!'; echo json_encode($msg);exit; } $model = M('Auction'); $lmodel = M('AuctionLog'); $rmodel = M('record'); $mmodel = M('Member'); $mwmodel = M('MemberWallet'); $mwlmodel = M('MemberWalletLog'); $data['id'] = $_POST['id']; $vo = $model->field('id,status,starttime,endtime,product_id,product_name,startprice,addprice,auctioncount,realprice,bond,user_id')->where($data)->find(); if(!$vo){ $msg['status'] = 0; $msg['notice'] = '拍品不存在!'; echo json_encode($msg);exit; } if($vo['starttime']>time()){ $msg['status'] = 0; $msg['notice'] = '还未开始拍卖!'; echo json_encode($msg);exit; } if($vo['endtime']<=time()){ $msg['status'] = 0; $msg['notice'] = '拍卖已结束!'; echo json_encode($msg);exit; } if($vo['type']==1){ $msg['status'] = 0; $msg['notice'] = '出错!'; echo json_encode($msg);exit; } $mwlmodel = M('MemberWalletLog'); $mwl_data['member_id'] = $this->user['id']; $mwl_data['pay_type'] = 1; $mwl_data['aid'] = $vo['id']; $mwl_count = $mwlmodel->where($mwl_data)->count(); if($mwl_count==0){ $msg['status'] = 0; $msg['notice'] = '请先付保证金!'; echo json_encode($msg);exit; } if(($this->user['frozen']+$this->user['balance'])<1){ $msg['status'] = 0; $msg['notice'] = '余额不足!'; echo json_encode($msg);exit; } if($this->user['id']==$vo['auctionuid']){ $msg['status'] = 0; $msg['notice'] = '目前您领先,无需再出价!'; echo json_encode($msg);exit; } $model->startTrans();//启用事务 //添加记录 $al_model = M('AuctionLog'); $al_add['aid'] = $_POST['id']; $al_add['product_id'] = $vo['product_id']; $al_add['product_name'] = $vo['product_name']; $al_add['member_id'] = $this->user['id']; $al_add['member_name'] = $this->user['username']; $al_add['realname'] = $this->user['realname']; $al_add['ip'] = $_SERVER['REMOTE_ADDR']; $al_add['address'] = ipfrom($_SERVER['REMOTE_ADDR']); $al_add['bidprice'] = $_POST['pay']; $al_add['create_time'] = time(); $result = $al_model->add($al_add); //竞拍失败 if($_POST['pay']>=$vo['realprice']){ }else{ //竞价成功 $sdata['auctioncount'] = $vo['auctioncount']+1; $sdata['realprice'] = $_POST['pay']; $sdata['auctionuid'] = $this->user['id']; $sdata['auctionuname'] = $this->user['username']; if($result)$result = $model->where($data)->save($sdata); } //扣除竞拍金 //竞价次数 $l_data['aid'] = $_POST['id']; $count = $lmodel->where($l_data)->count(); //冻结金还剩多少 if($vo['bond']-$count>1){ $mw_wdata['member_id'] = $this->user['id']; if($result)$result=$mwmodel->where($mw_wdata)->setDec('frozen',1); $mwl_add_data['title'] = '订金扣除'; $mwl_add_data['member_id'] = $this->user['id']; $mwl_add_data['pay'] = $_POST['pay']; $mwl_add_data['aid'] = $_POST['id']; $mwl_add_data['pay_type'] = 3; $mwl_add_data['content'] = '低价者得,拍品:'.$val['product_name'].',竞拍失败扣除订金1元'; $mwl_add_data['create_time'] = time(); if($result)$result = $mwlmodel->add($mwl_add_data); }else{ $mw_wdata['member_id'] = $this->user['id']; if($result)$result=$mwmodel->where($mw_wdata)->setDec('balance',1); $rdata['member_id'] = $this->user['id']; $rdata['member_name'] = $this->user['username']; $rdata['realname'] = $this->user['realname']; $rdata['pay'] = 1; $rdata['balance'] = $this->user['balance']-1; $rdata['order_id'] = build_order_no($this->user['id']); $rdata['pay_order_id'] = build_order_no($this->user['id']); $rdata['payment_company'] = C('company_name'); $rdata['pay_type'] = 2; $rdata['content'] = '低价者得,拍品:'.$val['product_name'].',竞拍失败扣除1元'; if($result)$result = $rmodel->add($rdata); } //转钱进入卖家账户 if($vo['user_id']){ //查找用户钱包 $mw_wdata['member_id'] = $vo['user_id']; if($result)$result=$mwmodel->where($mw_wdata)->setInc('balance',1); $m_data['a.id'] = $vo['user_id']; $wallet_vo = $mmodel->alias('a')->join('`'.C('DB_PREFIX').'member_wallet` as b on a.id=b.member_id')->field('a.id,logo,email,utype,password,username,realname,tel,pv_id,ct_id,province,city,create_time,last_login_time,balance,frozen,b.update_time,cp')->where($m_data)->find(); $rdata['member_id'] = $wallet_vo['id']; $rdata['member_name'] = $wallet_vo['username']; $rdata['realname'] = $wallet_vo['realname']; $rdata['pay'] = 1; $rdata['balance'] = $wallet_vo['balance']+1; $rdata['order_id'] = build_order_no($this->user['id']); $rdata['pay_order_id'] = build_order_no($this->user['id']); $rdata['payment_company'] = C('company_name'); $rdata['pay_type'] = 5; $rdata['content'] = '低价者得,拍品:'.$val['product_name'].',竞拍收入1元'; if($result)$result = $rmodel->add($rdata); } //echo $rmodel->getlastsql();exit; if($result){ $model->commit(); if($_POST['pay']>=$vo['realprice']){ $msg['status'] = 1; $msg['notice'] = '很遗憾,您出价太高了!'; echo json_encode($msg);exit; }else{ $msg['status'] = 1; $msg['notice'] = '出价成功,领先!'; echo json_encode($msg);exit; } }else{ $model->rollback(); $msg['status'] = 0; $msg['notice'] = '出错!'; echo json_encode($msg);exit; } }
<?php require dirname(__FILE__) . "/" . "global.php"; if (!$lfjid) { showerr("你还没登录"); } if ($webdb[propagandize_close]) { showerr("系统没有开放此功能"); } $rows = 20; if (!$page) { $page = 1; } $min = ($page - 1) * $rows; $showpage = getpage("`{$pre}propagandize`", "WHERE uid='{$lfjuid}'", "?"); $query = $db->query("SELECT * FROM `{$pre}propagandize` WHERE uid='{$lfjuid}' ORDER BY id DESC LIMIT {$min},{$rows}"); while ($rs = $db->fetch_array($query)) { $rs[ip] = long2ip($rs[ip]); $rs[ipfrom] = ipfrom($rs[ipfrom]); $rs[posttime] = date("Y-m-d H:i", $rs[posttime]); $listdb[] = $rs; } require dirname(__FILE__) . "/" . "head.php"; require dirname(__FILE__) . "/" . "template/propagandize.htm"; require dirname(__FILE__) . "/" . "foot.php";