|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
use yii\helpers\Html; |
|
4
|
|
|
use yii\grid\GridView; |
|
5
|
|
|
use yii\bootstrap\ActiveForm; |
|
6
|
|
|
use common\models\OrderDeposit; |
|
7
|
|
|
use kartik\datetime\DateTimePicker; |
|
8
|
|
|
use yii\helpers\Url; |
|
9
|
|
|
use yii\web\View; |
|
10
|
|
|
|
|
11
|
|
|
/* @var $this yii\web\View */ |
|
12
|
|
|
/* @var $searchModel backend\models\SearchOrder */ |
|
13
|
|
|
/* @var $dataProvider yii\data\ActiveDataProvider */ |
|
14
|
|
|
|
|
15
|
|
|
$this->title = Yii::t('app', '京东订单管理'); |
|
16
|
|
|
$this->params['breadcrumbs'][] = $this->title; |
|
17
|
|
|
$css = <<<CSS |
|
18
|
|
|
#search-option{ |
|
19
|
|
|
|
|
20
|
|
|
} |
|
21
|
|
|
CSS; |
|
22
|
|
|
$this->registerCss($css); |
|
23
|
|
|
?> |
|
24
|
|
|
<div class="premium-order-index"> |
|
25
|
|
|
<div id="search-option"> |
|
26
|
|
|
<?php $form = ActiveForm::begin([ |
|
27
|
|
|
'method' => 'get', |
|
28
|
|
|
'fieldConfig' => [ |
|
29
|
|
|
'template' => "<div class=\"col-lg-3\">{input}</div>", |
|
30
|
|
|
'labelOptions' => ['class' => 'col-lg-3 control-label'], |
|
31
|
|
|
] |
|
32
|
|
|
]); ?> |
|
33
|
|
|
|
|
34
|
|
|
<?= $form->field($searchModel, 'sn')->textInput(['placeholder' => '订单号'])->label(null); ?> |
|
35
|
|
|
|
|
36
|
|
|
<?= $form->field($searchModel, 'status')->dropDownList(['' => '支付状态'] + OrderDeposit::getStatusList())->label(null); ?> |
|
37
|
|
|
|
|
38
|
|
|
<?= $form->field($searchModel, 'start_time')->widget(DateTimePicker::classname(), |
|
39
|
|
|
['options' => ['placeholder' => '开始时间'], |
|
40
|
|
|
'pluginOptions' => [ |
|
41
|
|
|
'autoclose' => true, |
|
42
|
|
|
'todayHighlight' => true, |
|
43
|
|
|
'format' => 'yyyy-mm-dd', |
|
44
|
|
|
'inline' => true, |
|
45
|
|
|
] |
|
46
|
|
|
])->label("预约开始时间"); |
|
47
|
|
|
?> |
|
48
|
|
|
<?= $form->field($searchModel, 'end_time')->widget(DateTimePicker::classname(), |
|
49
|
|
|
['options' => ['placeholder' => '截止时间'], |
|
50
|
|
|
'pluginOptions' => [ |
|
51
|
|
|
'autoclose' => true, |
|
52
|
|
|
'todayHighlight' => true, |
|
53
|
|
|
'format' => 'yyyy-mm-dd', |
|
54
|
|
|
'inline' => true, |
|
55
|
|
|
] |
|
56
|
|
|
])->label(' 预约结束时间 '); |
|
57
|
|
|
?> |
|
58
|
|
|
<div class="col-lg-3"> |
|
59
|
|
|
<?= Html::submitButton('搜索', ['class' => 'btn btn-primary']) ?> |
|
60
|
|
|
<?php ActiveForm::end(); ?> |
|
61
|
|
|
</div> |
|
62
|
|
|
</div> |
|
63
|
|
|
<div class="order-index"> |
|
64
|
|
|
|
|
65
|
|
|
<?= GridView::widget([ |
|
66
|
|
|
'dataProvider' => $dataProvider, |
|
67
|
|
|
'columns' => [ |
|
68
|
|
|
['class' => 'yii\grid\SerialColumn'], |
|
69
|
|
|
'sn', |
|
70
|
|
|
'name', |
|
71
|
|
|
//'game_id', |
|
72
|
|
|
// 'user_id', |
|
73
|
|
|
// 'current_tiers', |
|
74
|
|
|
// 'current_divisions', |
|
75
|
|
|
// 'target_tiers', |
|
76
|
|
|
// 'target_divisions', |
|
77
|
|
|
// 'mingwen', |
|
78
|
|
|
'final_price', |
|
79
|
|
|
// 'equipment', |
|
80
|
|
|
// 'serverinfo', |
|
81
|
|
|
// 'password', |
|
82
|
|
|
// 'remark', |
|
83
|
|
|
'created_at:dateTime', |
|
84
|
|
|
[ |
|
85
|
|
|
'attribute' => 'payment_method', |
|
86
|
|
|
'value' => function ($model) { |
|
|
|
|
|
|
87
|
|
|
return '京东支付'; |
|
88
|
|
|
} |
|
89
|
|
|
], |
|
90
|
|
|
[ |
|
91
|
|
|
'attribute' => 'status', |
|
92
|
|
|
'value' => function ($model) { |
|
93
|
|
|
return OrderDeposit::getStatusList()[$model->status]; |
|
94
|
|
|
} |
|
95
|
|
|
], |
|
96
|
|
|
// 'client_id', |
|
97
|
|
|
// 'description', |
|
98
|
|
|
[ |
|
99
|
|
|
'class' => 'yii\grid\ActionColumn', |
|
100
|
|
|
'template' => '{view} {successStatus} {failStatus}', |
|
101
|
|
|
'buttons' => [ |
|
102
|
|
|
'successStatus' => function ($url, $model, $key) { |
|
|
|
|
|
|
103
|
|
|
return Html::a('<span>充值成功</span>', 'javascript:void(0);', [ |
|
104
|
|
|
'title' => '充值成功', |
|
105
|
|
|
'onclick' => 'changeStatus(' . substr($model->sn, 2) . ',0,this)' |
|
106
|
|
|
]); |
|
107
|
|
|
}, |
|
108
|
|
|
'failStatus' => function ($url, $model, $key) { |
|
|
|
|
|
|
109
|
|
|
return Html::a('<span>充值失败</span>', 'javascript:void(0);', [ |
|
110
|
|
|
'title' => '充值失败', |
|
111
|
|
|
'onclick' => 'changeStatus(' . substr($model->sn, 2) . ',2,this)' |
|
112
|
|
|
]); |
|
113
|
|
|
}, |
|
114
|
|
|
], |
|
115
|
|
|
], |
|
116
|
|
|
], |
|
117
|
|
|
]); ?> |
|
118
|
|
|
</div> |
|
119
|
|
|
<?php |
|
120
|
|
|
$url = Url::to(['deposit/game']); |
|
121
|
|
|
$js = <<<JS |
|
122
|
|
|
function changeStatus(orderId,status,target){ |
|
123
|
|
|
$.ajax({ |
|
124
|
|
|
type: 'POST', |
|
125
|
|
|
data: { |
|
126
|
|
|
orderId:orderId, |
|
127
|
|
|
orderStatus:status |
|
128
|
|
|
}, |
|
129
|
|
|
cache: false, |
|
130
|
|
|
url: '$url', |
|
131
|
|
|
success: function(response) { |
|
132
|
|
|
if(response.retCode==100){ |
|
133
|
|
|
console.log(response); |
|
134
|
|
|
$(target).parent().prev().html('充值成功'); |
|
135
|
|
|
}else{ |
|
136
|
|
|
alert("修改订单失败") |
|
137
|
|
|
} |
|
138
|
|
|
} |
|
139
|
|
|
}); |
|
140
|
|
|
} |
|
141
|
|
|
JS; |
|
142
|
|
|
$this->registerJs($js, View::POS_END); |
|
143
|
|
|
?> |
|
144
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.