本文整理匯總了PHP中MTip函數的典型用法代碼示例。如果您正苦於以下問題:PHP MTip函數的具體用法?PHP MTip怎麽用?PHP MTip使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了MTip函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: bindbank
public function bindbank()
{
$oldaccount = M('member_banks')->getFieldByUid($this->uid, 'bank_num');
$data['uid'] = $this->uid;
$data['bank_num'] = text($_POST['account']);
$data['bank_name'] = text($_POST['bankname']);
$data['bank_address'] = text($_POST['bankaddress']);
$data['bank_province'] = text($_POST['province']);
$data['bank_city'] = text($_POST['cityName']);
$data['add_ip'] = get_client_ip();
$data['add_time'] = time();
//短信校驗
$smscode = text($_POST['smscode']);
if (!is_verify($this->uid, $smscode, 11, 10 * 60)) {
ajaxmsg('短信驗證碼不對,請重新輸入!', 0);
}
if ($oldaccount) {
$old = text($_POST['oldaccount']);
if ($old != $oldaccount) {
ajaxmsg('原銀卡號不對', 0);
}
$newid = M('member_banks')->save($data);
} else {
$newid = M('member_banks')->add($data);
}
if ($newid) {
MTip('chk2', $this->uid);
ajaxmsg();
} else {
ajaxmsg('操作失敗,請重試', 0);
}
}
示例2: bindbank
public function bindbank()
{
$bank_info = M('member_banks')->field("uid, bank_num")->where("uid=" . $this->uid)->find();
!$bank_info['uid'] && ($data['uid'] = $this->uid);
$data['bank_num'] = text($_POST['account']);
$data['bank_name'] = text($_POST['bankname']);
$data['bank_address'] = text($_POST['bankaddress']);
$data['bank_province'] = text($_POST['province']);
$data['bank_city'] = text($_POST['cityName']);
$data['add_ip'] = get_client_ip();
$data['add_time'] = time();
if ($bank_info['uid']) {
/////////////////////新增銀行卡修改鎖定開關 開始 20130510 fans///////////////////////////
if (intval($this->glo['edit_bank']) != 1 && $bank_info['bank_num']) {
ajaxmsg("為了您的帳戶資金安全,銀行卡已鎖定,如需修改,請聯係客服", 0);
}
/////////////////////新增銀行卡修改鎖定開關 結束 20130510 fans///////////////////////////
$old = text($_POST['oldaccount']);
if ($bank_info['bank_num'] && $old != $bank_info['bank_num']) {
ajaxmsg('原銀卡號不對', 0);
}
$newid = M('member_banks')->where("uid=" . $this->uid)->save($data);
} else {
$newid = M('member_banks')->add($data);
}
if ($newid) {
MTip('chk2', $this->uid);
ajaxmsg();
} else {
ajaxmsg('操作失敗,請重試', 0);
}
}
示例3: changepass
public function changepass()
{
$old = md5($_POST['oldpwd']);
$newpwd1 = md5($_POST['newpwd1']);
$c = M('members')->where("id={$this->uid} AND user_pass = '{$old}'")->count('id');
if ($c == 0) {
ajaxmsg('', 2);
}
$newid = M('members')->where("id={$this->uid}")->setField('user_pass', $newpwd1);
if ($newid) {
MTip('chk1', $this->uid);
ajaxmsg();
} else {
ajaxmsg('', 0);
}
}
示例4: withdraw
public function withdraw()
{
import("ORG.Loan.Escrow");
$loan = new Escrow();
if ($loan->withdrawVerify($_POST)) {
$orders = $_POST['OrderNo'];
$id = substr($orders, 12);
$vo = M('member_withdraw')->field('uid,withdraw_money,withdraw_fee,withdraw_status, loanno')->where("id={$id}")->find();
$uid = $vo['uid'];
if ($_POST['ResultCode'] == '88' && !$vo['withdraw_status']) {
// 成功
$FreeLimit = $_POST['FreeLimit'];
$FeeWithdraws = $_POST['FeeWithdraws'];
$Amount = $_POST['Amount'];
$updata['withdraw_status'] = 1;
$updata['second_fee'] = $_POST['FeeWithdraws'];
$updata['withdraw_fee'] = $FeeWithdraws;
$updata['loanno'] = $_POST['LoanNo'];
$xid = M('member_withdraw')->where("uid={$vo['uid']} AND id={$id}")->save($updata);
if ($xid) {
$amoney = $_POST['Amount'] - $_POST['FeeWithdraws'];
memberMoneyLog($uid, 29, $_POST['Amount'], "提現成功,扣除實際手續費" . $FeeWithdraws . "元,到帳金額" . $amoney . "元", '0', '@網站管理員@', 0);
MTip('chk6', $uid);
echo "SUCCESS";
notifyMsg('提現', $_POST, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'SUCCESS');
exit;
}
} elseif ($_POST['ResultCode'] == '89' && $vo['withdraw_status'] == 1) {
//退回資金
$updata['withdraw_status'] = 2;
$xid = M('member_withdraw')->where("uid={$uid} AND id={$id}")->save($updata);
if ($xid) {
memberMoneyLog($uid, 5, $_POST['Amount'], "提現退回資金{$_POST['Amount']}元", '0', '@網站管理員@', 0);
notifyMsg('提現退回', $_POST, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'SUCCESS');
echo "SUCCESS";
exit;
}
}
notifyMsg('提現', $_POST, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], '');
}
}
示例5: withdraw
/**
* 提現通知地址
*
*/
public function withdraw()
{
if ($_POST['ResultCode'] == '88') {
import("ORG.Loan.Escrow");
$loan = new Escrow();
if ($loan->withdrawVerify($_POST)) {
$updata['withdraw_status'] = 1;
$id = $_REQUEST['OrderNo'];
$vo = M('member_withdraw')->field('uid,money,fee,member_status')->where("id='{$id}'")->find();
//if($vo['status']!=0 || !is_array($vo)) return;
$xid = $withdrawlog->where("uid={$vo['uid']} AND id='{$id}'")->save($updata);
$tmoney = floatval($vo['money'] - $vo['fee']);
memberMoneyLog($this->uid, 4, -$withdraw_money, "提現,默認自動扣減手續費" . $fee . "元", '0', '@網站管理員@', 0);
MTip('chk6', $this->uid);
if (M('member_withdraw')->save($updata)) {
notifyMsg('提現', $_POST, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'SUCCESS');
echo "SUCCESS";
exit;
}
notifyMsg('提現', $_POST, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], '');
}
}
}
示例6: actwithdraw
public function actwithdraw()
{
$pre = C('DB_PREFIX');
$withdraw_money = floatval($_POST['amount']);
$pwd = md5($_POST['pwd']);
$vo = M('members m')->field('mm.account_money,mm.back_money,(mm.account_money+mm.back_money) all_money,m.user_leve,m.time_limit')->join("{$pre}member_money mm on mm.uid = m.id")->where("m.id={$this->uid} AND m.pin_pass='{$pwd}'")->find();
if (!is_array($vo)) {
ajaxmsg("", 0);
}
if ($vo['all_money'] < $withdraw_money) {
ajaxmsg("提現額大於帳戶餘額", 2);
}
$wmap['uid'] = $this->uid;
if (1 == 1 || $vo['user_leve'] > 0 && $vo['time_limit'] > time()) {
$fee = 5;
if ($vo['all_money'] - $withdraw_money - $fee < 0) {
$moneydata['withdraw_money'] = $withdraw_money;
$moneydata['withdraw_fee'] = $fee;
$moneydata['second_fee'] = $fee;
$moneydata['withdraw_status'] = 0;
$moneydata['uid'] = $this->uid;
$moneydata['add_time'] = time();
$moneydata['add_ip'] = get_client_ip();
$newid = M('member_withdraw')->add($moneydata);
if ($newid) {
memberMoneyLog($this->uid, 4, -$withdraw_money, "提現,默認自動扣減手續費" . $fee . "元", '0', '@網站管理員@', 0);
MTip('chk6', $this->uid);
ajaxmsg("恭喜,提現申請提交成功", 1);
}
} else {
$moneydata['withdraw_money'] = $withdraw_money;
$moneydata['withdraw_fee'] = $fee;
$moneydata['second_fee'] = $fee;
$moneydata['withdraw_status'] = 0;
$moneydata['uid'] = $this->uid;
$moneydata['add_time'] = time();
$moneydata['add_ip'] = get_client_ip();
$newid = M('member_withdraw')->add($moneydata);
if ($newid) {
memberMoneyLog($this->uid, 4, -$withdraw_money, "提現,默認自動扣減手續費" . $fee . "元", '0', '@網站管理員@');
MTip('chk6', $this->uid);
ajaxmsg("恭喜,提現申請提交成功", 1);
}
}
ajaxmsg("對不起,提現出錯,請重試", 2);
} else {
$fee = 5;
if ($vo['account_money'] - $withdraw_money - $fee < 0) {
$withdraw_money = $withdraw_money - $fee;
$moneydata['withdraw_money'] = $withdraw_money;
$moneydata['withdraw_fee'] = $fee;
$moneydata['withdraw_status'] = 0;
$moneydata['uid'] = $this->uid;
$moneydata['add_time'] = time();
$moneydata['add_ip'] = get_client_ip();
$newid = M('member_withdraw')->add($moneydata);
if ($newid) {
memberMoneyLog($this->uid, 4, -$withdraw_money - $fee, "提現,自動扣減手續費" . $fee . "元");
MTip('chk6', $this->uid);
ajaxmsg("恭喜,提現申請提交成功", 1);
}
} else {
$moneydata['withdraw_money'] = $withdraw_money;
$moneydata['withdraw_fee'] = $fee;
$moneydata['withdraw_status'] = 0;
$moneydata['uid'] = $this->uid;
$moneydata['add_time'] = time();
$moneydata['add_ip'] = get_client_ip();
$newid = M('member_withdraw')->add($moneydata);
if ($newid) {
memberMoneyLog($this->uid, 4, -$withdraw_money, "提現,自動扣減手續費" . $fee . "元", '0', '@網站管理員@', -$fee);
MTip('chk6', $this->uid);
ajaxmsg("恭喜,提現申請提交成功", 1);
}
}
ajaxmsg("對不起,提現出錯,請重試", 2);
}
}
示例7: index
//.........這裏部分代碼省略.........
$listTBorrow = getTBorrowList($parm);
//dump($listTBorrow);die;
$this->assign("listTBorrow", $listTBorrow);
///////////////企業直投列表結束 gwf 2014-10-21//////////////
$this->display();
/****************************募集期內標未滿,自動流標 新增 2013-03-13****************************/
//流標返回
$mapT = array();
$mapT['collect_time'] = array("lt", time());
$mapT['borrow_status'] = 2;
$tlist = M("borrow_info")->field("id,borrow_uid,borrow_type,borrow_money,first_verify_time,borrow_interest_rate,borrow_duration,repayment_type,collect_day,collect_time")->where($mapT)->select();
if (empty($tlist)) {
exit;
}
foreach ($tlist as $key => $vbx) {
$borrow_id = $vbx['id'];
//流標
$done = false;
$borrowInvestor = D('borrow_investor');
$binfo = M("borrow_info")->field("borrow_type,borrow_money,borrow_uid,borrow_duration,repayment_type")->find($borrow_id);
$investorList = $borrowInvestor->field('id,investor_uid,investor_capital')->where("borrow_id={$borrow_id}")->select();
M('investor_detail')->where("borrow_id={$borrow_id}")->delete();
if ($binfo['borrow_type'] == 1) {
$limit_credit = memberLimitLog($binfo['borrow_uid'], 12, $binfo['borrow_money'], $info = "{$binfo['id']}號標流標");
}
//返回額度
$borrowInvestor->startTrans();
$bstatus = 3;
$upborrow_info = M('borrow_info')->where("id={$borrow_id}")->setField("borrow_status", $bstatus);
//處理借款概要
$buname = M('members')->getFieldById($binfo['borrow_uid'], 'user_name');
//處理借款概要
if (is_array($investorList)) {
$upsummary_res = M('borrow_investor')->where("borrow_id={$borrow_id}")->setField("status", $type);
foreach ($investorList as $v) {
MTip('chk15', $v['investor_uid']);
//sss
$accountMoney_investor = M("member_money")->field(true)->find($v['investor_uid']);
$datamoney_x['uid'] = $v['investor_uid'];
$datamoney_x['type'] = $type == 3 ? 16 : 8;
$datamoney_x['affect_money'] = $v['investor_capital'];
$datamoney_x['account_money'] = $accountMoney_investor['account_money'] + $datamoney_x['affect_money'];
//投標不成功返回充值資金池
$datamoney_x['collect_money'] = $accountMoney_investor['money_collect'];
$datamoney_x['freeze_money'] = $accountMoney_investor['money_freeze'] - $datamoney_x['affect_money'];
$datamoney_x['back_money'] = $accountMoney_investor['back_money'];
//會員帳戶
$mmoney_x['money_freeze'] = $datamoney_x['freeze_money'];
$mmoney_x['money_collect'] = $datamoney_x['collect_money'];
$mmoney_x['account_money'] = $datamoney_x['account_money'];
$mmoney_x['back_money'] = $datamoney_x['back_money'];
//會員帳戶
$_xstr = $type == 3 ? "複審未通過" : "募集期內標未滿,流標";
$datamoney_x['info'] = "第{$borrow_id}號標" . $_xstr . ",返回凍結資金";
$datamoney_x['add_time'] = time();
$datamoney_x['add_ip'] = get_client_ip();
$datamoney_x['target_uid'] = $binfo['borrow_uid'];
$datamoney_x['target_uname'] = $buname;
$moneynewid_x = M('member_moneylog')->add($datamoney_x);
if ($moneynewid_x) {
$bxid = M('member_money')->where("uid={$datamoney_x['uid']}")->save($mmoney_x);
}
}
} else {
$moneynewid_x = true;
$bxid = true;
$upsummary_res = true;
}
if ($moneynewid_x && $upsummary_res && $bxid && $upborrow_info) {
$done = true;
$borrowInvestor->commit();
} else {
$borrowInvestor->rollback();
}
if (!$done) {
continue;
}
MTip('chk11', $vbx['borrow_uid'], $borrow_id);
$verify_info['borrow_id'] = $borrow_id;
$verify_info['deal_info_2'] = text($_POST['deal_info_2']);
$verify_info['deal_user_2'] = 0;
$verify_info['deal_time_2'] = time();
$verify_info['deal_status_2'] = 3;
if ($vbx['first_verify_time'] > 0) {
M('borrow_verify')->save($verify_info);
} else {
M('borrow_verify')->add($verify_info);
}
$vss = M("members")->field("user_phone,user_name")->where("id = {$vbx['borrow_uid']}")->find();
SMStip("refuse", $vss['user_phone'], array("#USERANEM#", "ID"), array($vss['user_name'], $verify_info['borrow_id']));
//@SMStip("refuse",$vss['user_phone'],array("#USERANEM#","ID"),array($vss['user_name'],$verify_info['borrow_id']));
//updateBinfo
$newBinfo = array();
$newBinfo['id'] = $borrow_id;
$newBinfo['borrow_status'] = 3;
$newBinfo['second_verify_time'] = time();
$x = M("borrow_info")->save($newBinfo);
}
/****************************募集期內標未滿,自動流標 新增 2013-03-13****************************/
}
示例8: doEditWaitmoney
public function doEditWaitmoney()
{
$m = D(ucfirst($this->getActionName()));
if (false === $m->create()) {
$this->error($m->getError());
}
$vm = M('borrow_info')->field('borrow_uid,borrow_type,borrow_money,first_verify_time,borrow_interest_rate,borrow_duration,repayment_type,collect_day,collect_time,borrow_fee,money_collect')->find($m->id);
if ($vm['borrow_money'] != $m->borrow_money || $vm['borrow_interest_rate'] != $m->borrow_interest_rate || $vm['borrow_duration'] != $m->borrow_duration || $vm['repayment_type'] != $m->repayment_type || $vm['borrow_fee'] != $m->borrow_fee) {
$this->error('招標中的借款不能再更改‘還款方式’,‘借款種類’,‘借款金額’,‘年化利率’,‘借款期限’,‘借款管理費’');
exit;
}
//招標中的借款流標
if ($m->borrow_status == 3) {
alogs("borrowRefuse", 0, 1, '流標操作成功!');
//管理員操作日誌
//流標返回
$appid = borrowRefuse($m->id, 2);
if (!$appid) {
alogs("borrowRefuse", 0, 0, '流標操作失敗!');
//管理員操作日誌
$this->error("流標失敗");
}
MTip('chk11', $vm['borrow_uid'], $m->id);
$m->second_verify_time = time();
//流標操作相當於複審
$verify_info['borrow_id'] = $m->id;
$verify_info['deal_info_2'] = text($_POST['deal_info_2']);
$verify_info['deal_user_2'] = $this->admin_id;
$verify_info['deal_time_2'] = time();
$verify_info['deal_status_2'] = $m->borrow_status;
if ($vm['first_verify_time'] > 0) {
M('borrow_verify')->save($verify_info);
} else {
M('borrow_verify')->add($verify_info);
}
$vss = M("members")->field("user_phone,user_name")->where("id = {$vm['borrow_uid']}")->find();
SMStip("refuse", $vss['user_phone'], array("#USERANEM#", "ID"), array($vss['user_name'], $m->id));
} else {
if ($vm['collect_day'] < $m->collect_day) {
$spanday = $m->collect_day - $vm['collect_day'];
$m->collect_time = strtotime("+ {$spanday} day", $vm['collect_time']);
}
unset($m->second_verify_time);
}
//保存當前數據對象
unset($m->borrow_uid);
////////////////////圖片編輯///////////////////////
foreach ($_POST['swfimglist'] as $key => $v) {
$row[$key]['img'] = substr($v, 1);
$row[$key]['info'] = $_POST['picinfo'][$key];
}
$m->updata = serialize($row);
////////////////////圖片編輯///////////////////////
if ($result = $m->save()) {
//保存成功
//$this->assign("waitSecond",10000);
alogs("borrowing", 0, 1, '招標中的借款操作修改成功!');
//管理員操作日誌
//成功提示
$this->assign('jumpUrl', __URL__ . "/" . session('listaction'));
$this->success(L('修改成功'));
} else {
alogs("borrowing", 0, 0, '招標中的借款操作修改失敗!');
//管理員操作日誌
//失敗提示
$this->error(L('修改失敗'));
}
}
示例9: doEditWaitmoney
public function doEditWaitmoney()
{
//複審的時候這些信息不允許更改
unset($_POST["repayment_type"]);
unset($_POST["borrow_money"]);
unset($_POST["borrow_interest_rate"]);
unset($_POST["borrow_duration"]);
unset($_POST["reward_type"]);
unset($_POST["can_auto"]);
unset($_POST["is_tuijian"]);
unset($_POST["borrow_type"]);
unset($_POST["borrow_fee"]);
unset($_POST["collect_day"]);
unset($_POST["borrow_max"]);
$m = D(ucfirst($this->getActionName()));
if (false === $m->create()) {
$this->error($m->getError());
}
//$vm = M('borrow_info')->field('borrow_uid,borrow_type,borrow_money,first_verify_time,borrow_interest_rate,borrow_duration,repayment_type,collect_day,collect_time')->find($m->id);
$vm = M('borrow_info')->alias('bi')->field('borrow_uid,borrow_status,borrow_type,first_verify_time,password,updata,borrow_name,borrow_money,borrow_interest_rate,repayment_type,borrow_duration,
borrow_info,pro_provide,can_auto,is_tuijian,borrow_fee,collect_day,borrow_max,reward_type,reward_num,bv.deal_info')->join("left join {$this->pre}borrow_verify bv on bi.id=bv.borrow_id")->where(array("bi.id" => $m->id))->find();
// if( $vm['borrow_money']<>$m->borrow_money ||
// $vm['borrow_interest_rate']<>$m->borrow_interest_rate ||
// $vm['borrow_duration']<>$m->borrow_duration ||
// $vm['borrow_type']<>$m->borrow_type ||
// $vm['repayment_type']<>$m->repayment_type
// ){
// $this->error('招標中的借款不能再更改‘還款方式’,‘借款種類’,‘借款金額’,‘年化利率’,‘借款期限’');
// exit;
// }
//招標中的借款流標
if ($m->borrow_status == 3) {
//流標返回
$appid = borrowRefuse($m->id, 2);
if (!$appid) {
$this->error("流標失敗");
}
MTip('chk11', $vm['borrow_uid'], $m->id);
$m->second_verify_time = time();
//流標操作相當於複審
$verify_info['borrow_id'] = $m->id;
$verify_info['deal_info_2'] = text($_POST['deal_info']);
$verify_info['deal_user_2'] = $this->admin_id;
$verify_info['deal_time_2'] = time();
$verify_info['deal_status_2'] = $m->borrow_status;
if ($vm['first_verify_time'] > 0) {
M('borrow_verify')->save($verify_info);
} else {
M('borrow_verify')->add($verify_info);
}
$vss = M("members")->field("user_phone,user_name")->where("id = {$vm['borrow_uid']}")->find();
SMStip("refuse", $vss['user_phone'], array("#USERANEM#", "ID"), array($vss['user_name'], $verify_info['borrow_id']), $verify_info['borrow_id'], array($vm['borrow_uid']));
} else {
if ($vm['collect_day'] < $m->collect_day) {
$spanday = $m->collect_day - $vm['collect_day'];
$m->collect_time = strtotime("+ {$spanday} day", $vm['collect_time']);
}
unset($m->second_verify_time);
}
//保存當前數據對象
unset($m->borrow_uid);
////////////////////圖片編輯///////////////////////
foreach ($_POST['swfimglist'] as $key => $v) {
$row[$key]['img'] = substr($v, 1);
$row[$key]['info'] = $_POST['picinfo'][$key];
}
$m->updata = serialize($row);
////////////////////圖片編輯///////////////////////
if (($result = $m->save()) !== false) {
//保存成功
//$this->assign("waitSecond",10000);
//成功提示
// 日誌記錄
unset($vm["repayment_type"]);
unset($vm["borrow_money"]);
unset($vm["borrow_interest_rate"]);
unset($vm["borrow_duration"]);
unset($vm["reward_type"]);
unset($vm["reward_num"]);
unset($vm["can_auto"]);
unset($vm["is_tuijian"]);
unset($vm["borrow_type"]);
unset($vm["borrow_fee"]);
unset($vm["collect_day"]);
unset($vm["borrow_max"]);
saveDataLog($_POST['id'], $vm, $_POST, C('BORROW_LOG_KEY'), session('adminname'), $this->admin_id, $this->logOpType["BORROW_OPT"][0]);
$this->assign('jumpUrl', __URL__ . "/" . session('listaction'));
$this->success('修改成功');
} else {
//失敗提示
$this->error('修改失敗');
}
}
示例10: index
//.........這裏部分代碼省略.........
$listFBorrow = getTBorrowList($parm);
//var_dump($listBorrow);
$this->assign("listFBorrow", $listFBorrow);
///////////////省心寶列表結束 fan 2014-06-13///////////////
$this->display();
/****************************募集期內標未滿,自動流標 新增 2013-03-13****************************/
//流標返回
$mapT = array();
$mapT['collect_time'] = array("lt", time());
$mapT['borrow_status'] = 2;
$tlist = M("borrow_info")->field("id,borrow_uid,borrow_type,borrow_money,first_verify_time,borrow_interest_rate,borrow_duration,repayment_type,collect_day,collect_time")->where($mapT)->select();
if (empty($tlist)) {
exit;
}
foreach ($tlist as $key => $vbx) {
$borrow_id = $vbx['id'];
//流標
$done = false;
$borrowInvestor = D('borrow_investor');
$binfo = M("borrow_info")->field("borrow_type,borrow_money,borrow_uid,borrow_duration,repayment_type")->find($borrow_id);
$investorList = $borrowInvestor->field('id,investor_uid,investor_capital')->where("borrow_id={$borrow_id}")->select();
M('investor_detail')->where("borrow_id={$borrow_id}")->delete();
if ($binfo['borrow_type'] == 1) {
$limit_credit = memberLimitLog($binfo['borrow_uid'], 12, $binfo['borrow_money'], $info = "{$binfo['id']}號標流標");
}
//返回額度
$borrowInvestor->startTrans();
$bstatus = 3;
$upborrow_info = M('borrow_info')->where("id={$borrow_id}")->setField("borrow_status", $bstatus);
//處理借款概要
$buname = M('members')->getFieldById($binfo['borrow_uid'], 'user_name');
//處理借款概要
if (is_array($investorList)) {
$upsummary_res = M('borrow_investor')->where("borrow_id={$borrow_id}")->setField("status", $type);
foreach ($investorList as $v) {
MTip('chk15', $v['investor_uid']);
//sss
$accountMoney_investor = M("member_money")->field(true)->find($v['investor_uid']);
$datamoney_x['uid'] = $v['investor_uid'];
$datamoney_x['type'] = $type == 3 ? 16 : 8;
$datamoney_x['affect_money'] = $v['investor_capital'];
$datamoney_x['account_money'] = $accountMoney_investor['account_money'] + $datamoney_x['affect_money'];
//投標不成功返回充值資金池
$datamoney_x['collect_money'] = $accountMoney_investor['money_collect'];
$datamoney_x['freeze_money'] = $accountMoney_investor['money_freeze'] - $datamoney_x['affect_money'];
$datamoney_x['back_money'] = $accountMoney_investor['back_money'];
//會員帳戶
$mmoney_x['money_freeze'] = $datamoney_x['freeze_money'];
$mmoney_x['money_collect'] = $datamoney_x['collect_money'];
$mmoney_x['account_money'] = $datamoney_x['account_money'];
$mmoney_x['back_money'] = $datamoney_x['back_money'];
//會員帳戶
$_xstr = $type == 3 ? "複審未通過" : "募集期內標未滿,流標";
$datamoney_x['info'] = "第{$borrow_id}號標" . $_xstr . ",返回凍結資金";
$datamoney_x['add_time'] = time();
$datamoney_x['add_ip'] = get_client_ip();
$datamoney_x['target_uid'] = $binfo['borrow_uid'];
$datamoney_x['target_uname'] = $buname;
$moneynewid_x = M('member_moneylog')->add($datamoney_x);
if ($moneynewid_x) {
$bxid = M('member_money')->where("uid={$datamoney_x['uid']}")->save($mmoney_x);
}
}
} else {
$moneynewid_x = true;
$bxid = true;
$upsummary_res = true;
}
if ($moneynewid_x && $upsummary_res && $bxid && $upborrow_info) {
$done = true;
$borrowInvestor->commit();
} else {
$borrowInvestor->rollback();
}
if (!$done) {
continue;
}
MTip('chk11', $vbx['borrow_uid'], $borrow_id);
$verify_info['borrow_id'] = $borrow_id;
$verify_info['deal_info_2'] = text($_POST['deal_info_2']);
$verify_info['deal_user_2'] = 0;
$verify_info['deal_time_2'] = time();
$verify_info['deal_status_2'] = 3;
if ($vbx['first_verify_time'] > 0) {
M('borrow_verify')->save($verify_info);
} else {
M('borrow_verify')->add($verify_info);
}
$vss = M("members")->field("user_phone,user_name")->where("id = {$vbx['borrow_uid']}")->find();
SMStip("refuse", $vss['user_phone'], array("#USERANEM#", "ID"), array($vss['user_name'], $verify_info['borrow_id']));
//@SMStip("refuse",$vss['user_phone'],array("#USERANEM#","ID"),array($vss['user_name'],$verify_info['borrow_id']));
//updateBinfo
$newBinfo = array();
$newBinfo['id'] = $borrow_id;
$newBinfo['borrow_status'] = 3;
$newBinfo['second_verify_time'] = time();
$x = M("borrow_info")->save($newBinfo);
}
/****************************募集期內標未滿,自動流標 新增 2013-03-13****************************/
}
示例11: setpassword
public function setpassword()
{
if (true === $_SESSION['vphone'] && $_SESSION['retrieve_name']) {
$password = $_POST['psw'];
$password1 = $_POST['psw1'];
if (empty($password)) {
ajaxmsg('請輸入密碼', 0);
}
if ($password != $password1) {
ajaxmsg('兩次密碼不一樣', 0);
}
$vo = M('members')->field('id,user_phone,user_pass')->where(array('user_name' => $_SESSION['retrieve_name']))->find();
if (!$vo) {
ajaxmsg('參數錯誤', 0);
}
if ($vo['user_phone'] != $_SESSION['retrieve_phone']) {
ajaxmsg('驗證碼不正確');
}
if (md5($password) == $vo['user_pass']) {
ajaxmsg('密碼修改成功');
}
$newid = M('members')->where("id={$vo['id']}")->setField('user_pass', md5($password));
if ($newid) {
MTip('chk1', $vo['id']);
ajaxmsg('密碼修改成功');
} else {
ajaxmsg('修改失敗', 0);
}
} else {
ajaxmsg('參數錯誤1', 0);
}
}
示例12: autoInvest
function autoInvest($borrow_id)
{
$binfo = M("borrow_info")->field('borrow_uid,borrow_money,borrow_type,repayment_type,borrow_interest_rate,borrow_duration,has_vouch,has_borrow,borrow_max,borrow_min,can_auto')->find($borrow_id);
if ($binfo['can_auto'] == '0') {
exit;
}
$map['a.is_use'] = 1;
$map['borrow_type'] = 1;
if ($map['a.end_time'] > 0) {
$map['a.end_time'] = array("gt", time());
}
$autolist = M("auto_borrow a")->join(C('DB_PREFIX') . "member_money m ON a.uid=m.uid")->join(C('DB_PREFIX') . "members ms ON a.uid=ms.id")->field("a.*,ms.usrid, m.account_money+m.back_money as money")->where($map)->order("a.invest_time asc")->select();
$needMoney = $binfo['borrow_money'] - $binfo['has_borrow'];
$pre = C('DB_PREFIX');
$info2 = M("members m")->field("m.usrid")->join("{$pre}borrow_info s ON s.borrow_uid=m.id")->where("s.id = " . $borrow_id)->find();
$borrowerid = $info2['usrid'];
$borrowid = $borrow_id;
$usrid = array();
$transamt = array();
foreach ($autolist as $key => $v) {
if (!$needMoney) {
break;
}
if ($v['uid'] == $binfo['borrow_uid']) {
continue;
}
$num_max1 = intval($v['money'] - $v['account_money']);
//賬戶餘額-設置的最少剩餘金額,即可用的投資金額數
$num_max4 = $binfo['borrow_money'] / 10;
//不能超過10%
//大於最大投標且設置最大投標
if ($investMoney > $binfo['borrow_max'] && $binfo['borrow_max'] > 0) {
$investMoney = $binfo['borrow_max'];
}
if ($num_max1 > $v['invest_money']) {
//如果可用的投資金額大於最大投資金額,則投資金額等於最大投資金額
$investMoney = $v['invest_money'];
} else {
$investMoney = $num_max1;
//如果未設置投標後賬戶餘額,則會投出全部餘額
}
if ($investMoney > $needMoney) {
$investMoney = $needMoney;
} else {
if ($binfo['borrow_min']) {
//設置了最小投標 如果直接滿標則不考慮最小投標
if ($investMoney < $binfo['borrow_min']) {
// 小於最低投標
continue;
//不符合最低投資金額
} elseif ($needMoney - $investMoney > 0 && $needMoney - $investMoney < $binfo['borrow_min']) {
// 剩餘金額小於最小投標金額
if ($investMoney - $binfo['borrow_min'] >= $binfo['borrow_min']) {
// 投資金額- 最小投資金額 大於最小投資金額
$investMoney = $investMoney - $binfo['borrow_min'];
// 投資 = 投資-最小投資(保證下次投資金額大於最小投資金額)
} else {
continue;
}
}
}
}
//投資金額不能大於借款金額的10%
if ($investMoney > $num_max4) {
$investMoney = $num_max4;
}
if ($investMoney % $binfo['borrow_min'] != 0) {
continue;
}
$tiaojian = "{$needMoney} > 0";
//可投金額大於0
if ($v['interest_rate'] > 0) {
$tiaojian .= " && " . $binfo['borrow_interest_rate'] . " >= " . $v['interest_rate'];
//利率範圍
}
if ($v['duration_from'] > 0 && $v['duration_to'] > 0 && $v['duration_from'] <= $v['duration_to']) {
$tiaojian .= " && (" . $binfo['borrow_duration'] . " >= " . $v['duration_from'] . " || " . $v['duration_from'] . "==0) && (" . $binfo['borrow_duration'] . " <= " . $v['duration_to'] . " || " . $v['duration_to'] . "==0)";
//借款期限範圍
}
$tiaojian .= " && " . $investMoney . " >= " . $v['min_invest'];
$tiaojian .= " && (" . $v['money'] . " - " . $v['account_money'] . ") >= " . $investMoney;
//餘額限製
if ($tiaojian) {
$usrid[] = $v['usrid'];
$transamt[] = $investMoney;
$needMoney = $needMoney - $investMoney;
// 減去剩餘已投金額
MTip('chk27', $v['uid'], $borrow_id, $v['id']);
//sss
M('auto_borrow')->where('id = ' . $v['id'])->save(array("invest_time" => time()));
}
}
/////////////////////////////////////////////////////匯付托管 2014-10-09///////////////////////////////////////////////////////////////
import("ORG.Huifu.Huifu");
$huifu = new Huifu();
$huifu->autoTender_multi($usrid, $transamt, $borrowerid, $borrowid);
/////////////////////////////////////////////////////匯付托管 END///////////////////////////////////////////////////////////////
return true;
}
示例13: actwithdraw
public function actwithdraw()
{
$pre = C('DB_PREFIX');
$withdraw_money = floatval($_POST['amount']);
$pwd = md5($_POST['pwd']);
$vo = M('members m')->field('mm.account_money,m.user_leve,m.time_limit')->join("{$pre}member_money mm on mm.uid = m.id")->where("m.id={$this->uid} AND m.pin_pass='{$pwd}'")->find();
if (!is_array($vo)) {
ajaxmsg("", 0);
}
if ($vo['account_money'] < $withdraw_money) {
ajaxmsg("提現額大於帳戶餘額", 2);
}
$start = strtotime(date("Y-m-d", time()) . " 00:00:00");
$end = strtotime(date("Y-m-d", time()) . " 23:59:59");
$wmap['uid'] = $this->uid;
$wmap['withdraw_status'] = array("neq", 3);
$wmap['add_time'] = array("between", "{$start},{$end}");
$today_money = M('member_withdraw')->where($wmap)->sum('withdraw_money');
if ($vo['user_leve'] > 0 && $vo['time_limit'] > time()) {
if ($today_money + $withdraw_money > 1000000) {
$message = "您是特權會員,單日提現上限為100萬元。您今日已經申請提現金額:{$today_money元},當前申請金額為:{$withdraw_money元},已超出單日上限,請您修改申請金額或改日再申請提現";
ajaxmsg($message, 2);
}
$tqfee = explode("|", $this->glo['fee_tqtx']);
$fee = getFloatValue($tqfee[0] * $withdraw_money / 100, 2);
$fee > $tqfee[1] ? $fee = $tqfee[1] : '';
if (1 == 2 && $vo['account_money'] - $withdraw_money - $fee < 0) {
$withdraw_money = $withdraw_money - $fee;
$moneydata['withdraw_money'] = $withdraw_money;
$moneydata['withdraw_fee'] = $fee;
$moneydata['withdraw_status'] = 0;
$moneydata['uid'] = $this->uid;
$moneydata['add_time'] = time();
$moneydata['add_ip'] = get_client_ip();
$newid = M('member_withdraw')->add($moneydata);
if ($newid) {
memberMoneyLog($this->uid, 4, -$withdraw_money - $fee, "提現");
MTip('chk6', $this->uid);
ajaxmsg("恭喜,提現申請提交成功", 1);
}
} else {
$moneydata['withdraw_money'] = $withdraw_money;
$moneydata['withdraw_fee'] = $fee;
$moneydata['withdraw_status'] = 0;
$moneydata['uid'] = $this->uid;
$moneydata['add_time'] = time();
$moneydata['add_ip'] = get_client_ip();
$newid = M('member_withdraw')->add($moneydata);
if ($newid) {
memberMoneyLog($this->uid, 4, -$withdraw_money, "提現");
MTip('chk6', $this->uid);
ajaxmsg("恭喜,提現申請提交成功", 1);
}
}
ajaxmsg("對不起,提現出錯,請重試", 2);
} else {
if ($today_money + $withdraw_money > 300000) {
$message = "您是普通會員,單日提現上限為30萬元。您今日已經申請提現金額:{$today_money元},當前申請金額為:{$withdraw_money元},已超出單日上限,請您修改申請金額或改日再申請提現";
ajaxmsg($message, 2);
}
$tqfee = $this->glo['fee_pttx'];
$fee = getFloatValue($tqfee * $withdraw_money / 100, 2);
if ($vo['account_money'] - $withdraw_money - $fee < 0) {
$withdraw_money = $withdraw_money - $fee;
$moneydata['withdraw_money'] = $withdraw_money;
$moneydata['withdraw_fee'] = $fee;
$moneydata['withdraw_status'] = 0;
$moneydata['uid'] = $this->uid;
$moneydata['add_time'] = time();
$moneydata['add_ip'] = get_client_ip();
$newid = M('member_withdraw')->add($moneydata);
if ($newid) {
memberMoneyLog($this->uid, 4, -$withdraw_money - $fee, "提現");
MTip('chk6', $this->uid);
ajaxmsg("恭喜,提現申請提交成功", 1);
}
} else {
$moneydata['withdraw_money'] = $withdraw_money;
$moneydata['withdraw_fee'] = $fee;
$moneydata['withdraw_status'] = 0;
$moneydata['uid'] = $this->uid;
$moneydata['add_time'] = time();
$moneydata['add_ip'] = get_client_ip();
$newid = M('member_withdraw')->add($moneydata);
if ($newid) {
memberMoneyLog($this->uid, 4, -($withdraw_money + $fee), "提現");
MTip('chk6', $this->uid);
ajaxmsg("恭喜,提現申請提交成功", 1);
}
}
ajaxmsg("對不起,提現出錯,請重試", 2);
}
}
示例14: index
//.........這裏部分代碼省略.........
$row[$v['type']]['name'] = $name[$v['type']];
}
$this->assign('staticslist', $row);
//理財產品
//$financial_arr = getFinancialData();
//$this->assign('financial_arr',$financial_arr);
////////////////////////////////////////////
$this->display();
/****************************募集期內標未滿,自動流標 新增 2013-03-13****************************/
//流標返回
$mapT = array();
$mapT['collect_time'] = array("lt", time());
$mapT['borrow_status'] = 2;
$tlist = M("borrow_info")->field("id,borrow_uid,borrow_type,borrow_money,first_verify_time,borrow_interest_rate,borrow_duration,repayment_type,collect_day,collect_time")->where($mapT)->select();
if (empty($tlist)) {
exit;
}
foreach ($tlist as $key => $vbx) {
$borrow_id = $vbx['id'];
//流標
$done = false;
$borrowInvestor = D('borrow_investor');
$binfo = M("borrow_info")->field("borrow_type,borrow_money,borrow_uid,borrow_duration,repayment_type")->find($borrow_id);
$investorList = $borrowInvestor->field('id,investor_uid,investor_capital')->where("borrow_id={$borrow_id}")->select();
M('investor_detail')->where("borrow_id={$borrow_id}")->delete();
if ($binfo['borrow_type'] == 1) {
$limit_credit = memberLimitLog($binfo['borrow_uid'], 12, $binfo['borrow_money'], $info = "{$binfo['id']}號標流標");
}
//返回額度
$borrowInvestor->startTrans();
$bstatus = $type = 3;
$upborrow_info = M('borrow_info')->where("id={$borrow_id}")->setField("borrow_status", $bstatus);
//處理借款概要
$buname = M('members')->getFieldById($binfo['borrow_uid'], 'user_name');
//處理借款概要
if (is_array($investorList)) {
$upsummary_res = M('borrow_investor')->where("borrow_id={$borrow_id}")->setField("status", $type);
foreach ($investorList as $v) {
MTip('chk15', $v['investor_uid'], $borrow_id);
//sss
$accountMoney_investor = M("member_money")->field(true)->find($v['investor_uid']);
$datamoney_x['uid'] = $v['investor_uid'];
$datamoney_x['type'] = 8;
$datamoney_x['affect_money'] = $v['investor_capital'];
$datamoney_x['account_money'] = $accountMoney_investor['account_money'] + $datamoney_x['affect_money'];
$datamoney_x['collect_money'] = $accountMoney_investor['money_collect'];
$datamoney_x['freeze_money'] = $accountMoney_investor['money_freeze'] - $datamoney_x['affect_money'];
//會員帳戶
$mmoney_x['money_freeze'] = $datamoney_x['freeze_money'];
$mmoney_x['money_collect'] = $datamoney_x['collect_money'];
$mmoney_x['account_money'] = $datamoney_x['account_money'];
//會員帳戶
$_xstr = "募集期內標未滿,流標";
$datamoney_x['info'] = "第{$borrow_id}號標" . $_xstr . ",返回凍結資金";
$datamoney_x['add_time'] = time();
$datamoney_x['add_ip'] = get_client_ip();
$datamoney_x['target_uid'] = $binfo['borrow_uid'];
$datamoney_x['target_uname'] = $buname;
$moneynewid_x = M('member_moneylog')->add($datamoney_x);
if ($moneynewid_x) {
$bxid = M('member_money')->where("uid={$datamoney_x['uid']}")->save($mmoney_x);
}
}
} else {
$moneynewid_x = true;
$bxid = true;
$upsummary_res = true;
}
if ($moneynewid_x && $upsummary_res && $bxid && $upborrow_info) {
$done = true;
$borrowInvestor->commit();
} else {
$borrowInvestor->rollback();
}
if (!$done) {
continue;
}
MTip('chk11', $vbx['borrow_uid'], $borrow_id);
$verify_info['borrow_id'] = $borrow_id;
$verify_info['deal_info_2'] = text($_POST['deal_info_2']);
$verify_info['deal_user_2'] = 0;
$verify_info['deal_time_2'] = time();
$verify_info['deal_status_2'] = 3;
if ($vbx['first_verify_time'] > 0) {
M('borrow_verify')->save($verify_info);
} else {
M('borrow_verify')->add($verify_info);
}
$vss = M("members")->field("user_phone,user_name")->where("id = {$vbx['borrow_uid']}")->find();
SMStip("refuse", $vss['user_phone'], array("#USERANEM#", "ID"), array($vss['user_name'], $verify_info['borrow_id']), $verify_info['borrow_id'], array($vbx['borrow_uid']));
//@SMStip("refuse",$vss['user_phone'],array("#USERANEM#","ID"),array($vss['user_name'],$verify_info['borrow_id']));
//updateBinfo
$newBinfo = array();
$newBinfo['id'] = $borrow_id;
$newBinfo['borrow_status'] = 3;
$newBinfo['second_verify_time'] = time();
$x = M("borrow_info")->save($newBinfo);
}
/****************************募集期內標未滿,自動流標 新增 2013-03-13****************************/
}
示例15: withdrawDone
private function withdrawDone($status, $nid, $oid)
{
$done = false;
$withdrawlog = D('member_withdraw');
if ($this->locked) {
return false;
}
$this->locked = true;
switch ($status) {
case 1:
$updata['status'] = $status;
$updata['tran_id'] = text($oid);
$vo = M('member_withdraw')->field('uid,money,fee,status')->where("nid='{$nid}'")->find();
if ($vo['status'] != 0 || !is_array($vo)) {
return;
}
$xid = $withdrawlog->where("uid={$vo['uid']} AND nid='{$nid}'")->save($updata);
$tmoney = floatval($vo['money'] - $vo['fee']);
memberMoneyLog($this->uid, 4, -$withdraw_money, "提現,默認自動扣減手續費" . $fee . "元", '0', '@網站管理員@', 0);
MTip('chk6', $this->uid);
//if(!$newid){
// $updata['status'] = 0;
// $Moneylog->where("uid={$vo['uid']} AND nid='{$nid}'")->save($updata);
// return false;
//}
//$vx = M("members")->field("user_phone,user_name")->find($vo['uid']);
//SMStip("payonline",$vx['user_phone'],array("#USERANEM#","#MONEY#"),array($vx['user_name'],$vo['money']));
break;
case 2:
$updata['status'] = $status;
$updata['tran_id'] = text($oid);
$xid = $withdrawlog->where("uid={$vo['uid']} AND nid='{$nid}'")->save($updata);
break;
case 3:
$updata['status'] = $status;
$xid = $withdrawlog->where("uid={$vo['uid']} AND nid='{$nid}'")->save($updata);
break;
}
if ($status > 0) {
if ($xid) {
$done = true;
}
}
$this->locked = false;
return $done;
}