80a6eda8
alex
примерный макет е...
|
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
use common\models\dummy\DateModel;
use Yii;
class ExportController extends Controller{
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'view' => [ 'POST' ],
],
],
];
}
public function actionIndex(){
// $model=new DynamicModel(['timeFrom','timeTo']);
// $model->addRule(['timeFrom','timeTo'],'string');
$model=new DateModel();
return $this->render('index',[
'model' => $model
]);
}
public function actionView(){
$model=new DateModel();
$model->load(Yii::$app->request->post());
#die(var_dump($model->attributes));
$date1=(new \DateTime($model->timeFrom))->getTimestamp();
$date2=(new \DateTime($model->timeTo))->getTimestamp();
|
84767bd5
Alexey Boroda
-Export small fixes
|
53
54
55
56
57
58
59
60
61
|
// die(var_dump($date1,$date2));
$data = Customer::find()
->where([
'between',
'created_at',
$date1,
$date2
])
|