Esempio n. 1
0
 /**
  * Finds the Withdrawal model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Withdrawal the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     $model = Yii::createObject(Withdrawal::className());
     if (($model = $model::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Esempio n. 2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Withdrawal::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['withdrawal_id' => $this->withdrawal_id, 'user_id' => $this->user_id, 'withdrawal_fee' => $this->withdrawal_fee, 'status' => $this->status, 'create_at' => $this->create_at, 'update_at' => $this->update_at]);
     $query->andFilterWhere(['like', 'withdrawal_account', $this->withdrawal_account])->andFilterWhere(['like', 'account_name', $this->account_name]);
     return $dataProvider;
 }
Esempio n. 3
0
<?php

use yii\helpers\Html;
use kartik\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel star\account\models\WithdrawalSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('account', 'Withdrawals');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="withdrawal-index">
    <?php 
echo GridView::widget(['export' => false, 'responsive' => false, 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'containerOptions' => ['style' => 'overflow: auto'], 'headerRowOptions' => ['class' => 'kartik-sheet-style'], 'filterRowOptions' => ['class' => 'kartik-sheet-style'], 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'withdrawal_id', 'user_id', 'withdrawal_fee', 'withdrawal_account', 'account_name', ['attribute' => 'status', 'value' => function ($model) {
    $status = $model->getStatusArray();
    return $status[$model->status];
}, 'filterType' => GridView::FILTER_SELECT2, 'filter' => Yii::createObject(\star\account\models\Withdrawal::className())->getStatusArray(), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Status'], 'format' => 'raw'], 'create_at:datetime', 'update_at:datetime', ['class' => 'yii\\grid\\ActionColumn']], 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-globe"></i> ' . Yii::t('account', 'Withdrawals') . '</h3>', 'type' => 'success', 'footer' => false], 'toolbar' => ['{export}', '{toggleData}'], 'toggleDataContainer' => ['class' => 'btn-group-sm'], 'exportContainer' => ['class' => 'btn-group-sm']]);
?>


</div>
Esempio n. 4
0
 public function actionWithdrawalLog()
 {
     $model = Yii::createObject(Withdrawal::className());
     $dataProvider = new ActiveDataProvider(['query' => $model::find()->where(['user_id' => Yii::$app->user->id])->orderBy(['create_at' => SORT_DESC, 'status' => 0])]);
     return $this->render('withdrawalLog', ['dataProvider' => $dataProvider]);
 }