Example #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = SinaRansom::find()->orderBy('id DESC');
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 10]]);
     $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(['id' => $this->id, 'uid' => $this->uid, 'money_sina' => $this->money_sina, 'status' => $this->status, 'create_at' => $this->create_at, 'update_at' => $this->update_at]);
     $query->andFilterWhere(['like', 'identity_id', $this->identity_id])->andFilterWhere(['like', 'out_trade_no', $this->out_trade_no])->andFilterWhere(['like', 'summary', $this->summary])->andFilterWhere(['like', 'trade_close_time', $this->trade_close_time])->andFilterWhere(['like', 'payer_id', $this->payer_id])->andFilterWhere(['like', 'payer_ip', $this->payer_ip])->andFilterWhere(['like', 'pay_method', $this->pay_method])->andFilterWhere(['like', 'payee_out_trade_no', $this->payee_out_trade_no])->andFilterWhere(['like', 'msg', $this->msg]);
     return $dataProvider;
 }
Example #2
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel common\models\sinapay\SinaWithdrawSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', '新浪提现操作');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="sina-withdraw-index">



    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'uid', 'out_trade_no', 'identity_id', 'card_id', 'site_balance', 'sina_balance', 'money', 'money_fund', 'money_site', 'money_sina', ['attribute' => 'status', 'format' => 'html', 'value' => function ($model) {
    if ($model->status === 5) {
        $class = 'label-success';
    } elseif ($model->status === 4) {
        $class = 'label-warning';
    } elseif ($model->status === 3) {
        $class = 'label-warning';
    } else {
        $class = 'label-danger';
    }
    return '<span class="label ' . $class . '">' . $model->statusLabel . '</span>';
}, 'filter' => Html::activeDropDownList($searchModel, 'status', \common\models\sinapay\SinaRansom::labels(), ['class' => 'form-control', 'prompt' => '请筛选'])], 'msg', ['attribute' => 'create_at', 'format' => ['date', 'php:Y-m-d H:i:s'], 'headerOptions' => ['width' => '100']]]]);
?>

</div>
Example #3
0
 /**
  * 记录新浪赎回操作
  * @param $uid
  * @param $identity_id
  * @param $out_trade_no
  * @param $summary
  * @param $trade_close_time
  * @param $payer_id
  * @param $payer_ip
  * @param $pay_method
  * @param $money_sina
  * @param $status
  * @param $msg
  * @return bool
  */
 private static function ransomLog($uid, $identity_id, $out_trade_no, $summary, $trade_close_time, $payer_id, $payer_ip, $pay_method, $money_sina, $status, $msg, $payee_out_trade_no = '')
 {
     $log = new SinaRansom();
     $log->uid = $uid;
     $log->identity_id = $identity_id;
     $log->out_trade_no = $out_trade_no;
     $log->summary = $summary;
     $log->trade_close_time = $trade_close_time;
     $log->payer_id = $payer_id;
     $log->payer_ip = $payer_ip;
     $log->pay_method = $pay_method;
     $log->money_sina = $money_sina;
     $log->status = $status;
     $log->msg = $msg;
     $log->payee_out_trade_no = $payee_out_trade_no;
     return $log->save();
 }
 /**
  * Finds the SinaRansom model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return SinaRansom the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = SinaRansom::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }