mirror of
https://github.com/janickiy/yii2-nomer
synced 2025-03-09 15:39:59 +00:00
26 lines
No EOL
691 B
PHP
26 lines
No EOL
691 B
PHP
<?php
|
|
namespace app\modules\admin\controllers;
|
|
|
|
use app\models\Checkout;
|
|
use yii\data\ActiveDataProvider;
|
|
use yii\db\Expression;
|
|
use yii\web\Controller;
|
|
|
|
class CheckoutsController extends AdminController {
|
|
|
|
public function actionIndex() {
|
|
$dataProvider = new ActiveDataProvider([
|
|
"query" => Checkout::find()->where(["tm_done" => null])
|
|
]);
|
|
|
|
return $this->render("index", ["dataProvider" => $dataProvider]);
|
|
}
|
|
|
|
public function actionDone($id) {
|
|
$checkout = Checkout::find()->where(["id" => $id])->one();
|
|
$checkout->tm_done = new Expression("NOW()");
|
|
$checkout->save();
|
|
|
|
return $this->redirect(["index"]);
|
|
}
|
|
} |