コード例 #1
0
ファイル: Accounts.php プロジェクト: Aimsam/BTCAutoTrade
 public function postAction()
 {
     $account_dao = new AccountDao();
     $account = array();
     $account['name'] = $this->getRequest()->getParam('name');
     $account['description'] = $this->getRequest()->getParam('description');
     $account['market_id'] = $this->getRequest()->getParam('market_id');
     $account['account_group_id'] = $this->getRequest()->getParam('account_group_id');
     $market_name = $this->getRequest()->getParam('market_name');
     $config_name_list = get_account_config_keys($market_name);
     $account_id = $account_dao->insertOne($account);
     $config_list = array();
     foreach ($config_name_list as $config_name) {
         $config_list[] = array('name' => $config_name, 'value' => $this->getRequest()->getParam($market_name . '_' . $config_name), 'account_id' => $account_id);
     }
     $account_config_dao = new AccountConfigDao('account_config');
     $account_config_dao->insert($config_list);
     $this->redirect('/accounts');
 }