mirror of
https://github.com/janickiy/yii2-nomer
synced 2025-03-09 15:39:59 +00:00
add files to project
This commit is contained in:
commit
5cac498444
3729 changed files with 836998 additions and 0 deletions
32
modules/admin/controllers/SubscriptionsController.php
Normal file
32
modules/admin/controllers/SubscriptionsController.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
namespace app\modules\admin\controllers;
|
||||
|
||||
use app\models\UserSub;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use yii\db\Expression;
|
||||
use yii\web\User;
|
||||
|
||||
class SubscriptionsController extends AdminController {
|
||||
|
||||
public function actionIndex() {
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
"query" => UserSub::find()
|
||||
]);
|
||||
|
||||
return $this->render("index", [
|
||||
"dataProvider" => $dataProvider
|
||||
]);
|
||||
}
|
||||
|
||||
public function actionTest() {
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
"query" => UserSub::find()->from(UserSub::tableName()." s")->innerJoin(UserSub::tableName()." s2", "s.original_transaction_id = s2.original_transaction_id")->where(new Expression("s.tm_expires::date - s.tm_purchase::date = 3"))->andWhere(new Expression("s2.tm_expires::date - s2.tm_purchase::date > 5"))
|
||||
]);
|
||||
|
||||
return $this->render("index", [
|
||||
"dataProvider" => $dataProvider
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue