Пример #1
0
 public function save_pay_log()
 {
     $deal_id = intval($_REQUEST['id']);
     $deal_info = M("Deal")->getById($deal_id);
     if ($deal_info) {
         $map['deal_id'] = $deal_info['id'];
         $model = D("DealPayLog");
         $paid_money = $model->where($map)->sum("money");
         $remain_money = $deal_info['pay_amount'] - $paid_money;
         $money = floatval($_REQUEST['money']);
         $log_info = strim($_REQUEST['log_info']);
         if ($deal_info['ips_bill_no'] > 0) {
             if ($remain_money > 0) {
                 $url = APP_ROOT . "/index.php?ctl=collocation&act=Transfer&pTransferType=1&deal_id=" . $deal_id . "&ref_data=" . $loan_data['repay_start_time'];
                 app_redirect($url);
             } else {
                 $this->error("筹款发放完成");
             }
         }
         if ($money <= 0 || $money > $remain_money) {
             $this->error("金额出错");
         } else {
             if ($deal_info['user_id'] > 0) {
                 if ($deal_info['ips_bill_no'] > 0) {
                 } else {
                     require_once APP_ROOT_PATH . "system/libs/user.php";
                     if ($log_info == "") {
                         $log_info = $deal_info['name'] . "项目筹款发放";
                     }
                     modify_account(array("money" => $money), $deal_info['user_id'], $log_info, array('money_type' => 22));
                     $log['deal_id'] = $deal_info['id'];
                     $log['money'] = $money;
                     $log['create_time'] = get_gmtime();
                     $log['log_info'] = $log_info;
                     $model->add($log);
                     save_log($log_info . $money, 1);
                     send_pay_success($log_info);
                     $this->success("筹款发放成功");
                 }
             } else {
                 $this->error("管理员创建项目,无需发放筹款");
             }
         }
     } else {
         $this->error("项目不存在");
     }
 }
Пример #2
0
 public function save_pay_log()
 {
     $deal_id = intval($_REQUEST['id']);
     $deal_info = M("Crowd")->getById($deal_id);
     if ($deal_info) {
         $map['deal_id'] = $deal_info['id'];
         $model = D("CrowdPayLog");
         $paid_money = $model->where($map)->sum("money");
         $remain_money = $deal_info['pay_amount'] - $paid_money;
         $money = doubleval($_REQUEST['money']);
         $log_info = strim($_REQUEST['log_info']);
         if ($money <= 0 || $money > $remain_money) {
             $this->error("金额出错");
         } else {
             if ($deal_info['user_id'] > 0) {
                 require_once APP_ROOT_PATH . "system/libs/user.php";
                 if ($log_info == "") {
                     $log_info = $deal_info['name'] . "项目筹款发放";
                 }
                 modify_account(array("money" => $money), $deal_info['user_id'], $log_info);
                 $log['deal_id'] = $deal_info['id'];
                 $log['money'] = $money;
                 $log['create_time'] = get_gmtime();
                 $log['log_info'] = $log_info;
                 $model->add($log);
                 save_log($log_info . $money, 1);
                 send_pay_success($log_info);
                 $this->success("筹款发放成功");
             } else {
                 $this->error("管理员创建项目,无需发放筹款");
             }
         }
     } else {
         $this->error("项目不存在");
     }
 }