Ejemplo n.º 1
0
 public function doEdit()
 {
     $model = D("member_withdrawlog");
     $status = intval($_POST['status']);
     $id = intval($_POST['id']);
     $deal_info = $_POST['deal_info'];
     $usrid = $_POST['usrid'];
     //用户客户号
     $ordid = $_POST['ordid'];
     //订单号
     $transamt = $_POST['transamt'];
     //交易金额
     if ($status == 1) {
         $auditflag = "S";
     } else {
         $auditflag = "R";
     }
     //$secondfee = floatval($_POST['withdraw_fee']);
     $info = $model->field('addtime')->where("id={$id} and (withdraw_status!=0)")->find();
     if ($info['add_time']) {
         $this->error("此提现初审已处理过,请不要重复处理!");
     }
     if (false === $model->create()) {
         $this->error($model->getError());
     }
     //保存当前数据对象
     $model->status = $status;
     $model->deal_info = $deal_info;
     $model->deal_time = time();
     //$model->deal_user=session('adminname');
     ////////////////////////
     $field = 'w.*,w.id,w.uid,(mm.account_money+mm.back_money) all_money,w.feeamt';
     $vo = M("member_withdrawlog w")->field($field)->join("lzh_member_money mm on w.uid = mm.uid")->find($id);
     $um = M('members')->field("user_name,user_phone")->find($vo['uid']);
     $member_money = M('member_money')->field("(back_money +account_money) as moneys")->where("uid = " . $vo['uid'])->find();
     if ($member_money['moneys'] < $transamt + $vo['feeamt']) {
         $this->error(L('用户余额不足,无法提现'));
     }
     if ($status == 1) {
         import("ORG.Huifu.Huifu");
         $huifu = new Huifu();
         //exit("222");
         $res = $huifu->cashAudit($usrid, $ordid, $transamt, $auditflag);
     }
     //exit("333");
     $result = $model->save();
     if ($result) {
         //保存成功
         alogs("withdraw", $id, $status, $deal_info);
         //管理员操作日志
         //成功提示
         $this->assign('jumpUrl', __URL__);
         $this->success(L('修改成功'));
     } else {
         alogs("withdraw", $id, $status, '提现处理操作失败!');
         //管理员操作日志
         //$this->assign("waitSecond",10000);
         //失败提示
         $this->error(L('修改失败'));
     }
 }
Ejemplo n.º 2
0
 public function quxianreturn()
 {
     $usrid = $_POST['UsrCustId'];
     $info = M("huifulog")->distinct(true)->field("uid,username")->where("usrid=" . $usrid)->find();
     $nowtime = time();
     $data = array();
     $data['uid'] = $info['uid'];
     //用户UID
     $data['username'] = $info['username'];
     //用户名
     $data['rescode'] = $_POST['RespCode'];
     //返回码
     $data['cmdid'] = $_POST['CmdId'];
     //消息类型
     $data['usrid'] = $_POST['UsrCustId'];
     //用户客户号
     $data['ordid'] = $_POST['OrdId'];
     //订单号
     $data['orddate'] = '';
     $data['trxid'] = '';
     $data['addtime'] = $nowtime;
     //记录时间
     $condition['uid'] = $data['uid'];
     $condition['ordid'] = $data['ordid'];
     $num = M("huifulog")->where($condition)->count();
     if ($num == 0) {
         M("huifulog")->add($data);
     }
     if (strcmp($_POST['RespCode'], "000") == 0) {
         //member_withdrawlog表记录取现日志
         $withdraw = array();
         $withdrawlog['uid'] = $info['uid'];
         //用户UID
         $withdrawlog['usrid'] = $_POST['UsrCustId'];
         //用户客户号
         $withdrawlog['ordid'] = $_POST['OrdId'];
         //订单号
         $withdrawlog['transamt'] = $_POST['TransAmt'];
         //取现金额
         $withdrawlog['status'] = 0;
         $withdrawlog['feeamt'] = $_POST['FeeAmt'];
         //取现手续费
         $withdrawlog['feecustid'] = $_POST['FeeCustId'];
         //手续费扣款客户号
         $withdrawlog['feeacctid'] = $_POST['FeeAcctId'];
         //手续费扣款子账户号
         $withdrawlog['servfee'] = $_POST['ServFee'];
         //服务费
         $withdrawlog['bankaccount'] = $_POST['OpenAcctId'];
         //开户银行帐号
         $withdrawlog['addtime'] = $nowtime;
         //记录时间
         sleep(1);
         //防止与前台回调同步到达
         $condition['uid'] = $withdrawlog['uid'];
         $condition['ordid'] = $withdrawlog['ordid'];
         $num = M("member_withdrawlog")->where($condition)->count();
         if ($num == 0) {
             M("member_withdrawlog")->add($withdrawlog);
             //取现复核
             $usrid = $data['usrid'];
             //用户客户号
             $ordid = $data['ordid'];
             //订单号
             $transamt = $withdrawlog['transamt'];
             //取现金额
             $auditflag = 'S';
             //通过
             import("ORG.Huifu.Huifu");
             $huifu = new Huifu();
             $huifu->cashAudit($usrid, $ordid, $transamt, $auditflag);
             //----------------add by whh 2015-10-28---------------------------
             $info2 = M("member_info")->field("real_name")->where("uid=" . $withdrawlog['uid'])->find();
             $msg = "尊敬的财来网投资人" . $info2['real_name'] . ",您于" . date('Y') . "年" . date('m') . "月" . date('d') . "日" . date('H') . ":" . date('i') . "分,在财来网汇付宝账号提现" . $_POST['TransAmt'] . "元,根据银行情况,将于1-2个工作日到账,敬请关注。详情请咨询客户经理,或致电400-079-8558";
             sendsms($info['username'], $msg);
             $data = array("member_id" => $withdrawlog['uid'], "content" => $msg);
             insert_push_information($data);
             // insert push information
             //---------------------------------------------------------------
         }
     }
     echo "RECV_ORD_ID_" . $_POST['OrdId'];
 }