Пример #1
0
 private function getOneinvitecode()
 {
     $invitCode = new DtbInviteCode();
     return $invitCode->getOneInviteCode();
 }
Пример #2
0
 public function submitOrderAction($raise_id)
 {
     //TODO 生成订单
     if ($this->request->isPost()) {
         $raise_id = intval($raise_id);
         $dtb_project = DtbRaiseProjectBasic::findFirstByraise_id($raise_id);
         $invest_order = new DtbProjectInvestOrder();
         $invest_money = $this->request->getPost('invest_money');
         $invest_code = $this->request->getPost('invest_code');
         $check_use_invite_code = false;
         if (empty($invest_code)) {
             $invite_code = DtbInviteCode::findFirstByinvite_code($invest_code);
             if ($invite_code) {
                 if ($invite_code['is_use'] == 0) {
                     $check_use_invite_code = true;
                 }
             }
         }
         $user_id = $this->cookies->get('user_id');
         if (!$check_use_invite_code) {
             $invest_code = '';
         }
         $params = array('invest_money' => $invest_money, 'invest_code' => $invest_code, 'equit_offered' => $invest_money, 'service_fee' => 0, 'bond' => 0, 'real_pay_fee' => $invest_money);
         $res = $invest_order->creatOrder($order_id, $raise_id, $dtb_project->now_wheel_id, $user_id, $params);
         if ($res) {
             //$this->flash->success('修改成功');
             $this->flash->success('认证成功');
             return $this->response->redirect('/invest/payForm/' . $order_id);
             //                return $this->dispatcher->forward(array(
             //                    'controller' => 'invest',
             //                    'action' => 'payForm',
             //                    "params" => array($order_id)
             //                ));
         } else {
             $this->flash->error("create order error");
         }
     }
 }