예제 #1
0
 public function checkMaxValue($attribute, $params)
 {
     if (!$this->hasErrors()) {
         $user_deposit = User::getDepositValue(Yii::$app->user->id);
         if ($this->withdrawValue > $user_deposit) {
             $this->addError($attribute, Yii::t('app', 'WITHDRAWFUNDSFORM_WITHDRAWVALUE_MAX_VALUE'));
         }
     }
 }
예제 #2
0
 public function actionTransactions()
 {
     echo '<pre>';
     print_r('actionTransactions');
     echo '</pre>';
     //die;
     $user_id = 19;
     $data = ['fantasy_id' => 7];
     $trans_descr = Transaction::buildTransactionDescrForSave(Transaction::TR_TYPE_FANTASY_PAYMENT, $data);
     echo '<pre>$trans_descr ';
     print_r($trans_descr);
     echo '</pre>';
     //die;
     $deposit_before = User::getDepositValue($user_id);
     $value = 10.9;
     echo '<pre>$deposit_before ';
     print_r($deposit_before);
     echo '</pre>';
     //die;
     //Transaction::saveTransaction($user_id, $deposit_before, $value, $trans_descr);
     $trans_txt = Transaction::buildTransactionDescr($trans_descr);
     echo '<pre>$trans_txt ';
     print_r($trans_txt);
     echo '</pre>';
     //die;
     die;
 }