fitness-web/console/controllers/DetstaConsoleController.php
2016-05-08 08:56:42 +02:00

43 lines
796 B
PHP

<?php
namespace console\controllers;
use yii\console\Controller;
use frontend\models\ContractForm;
use common\models\TicketType;
use common\models\Customer;
use common\models\Transfer;
class DetstaConsoleController extends Controller{
public function actionCreateContract(){
$contractForm = new ContractForm(
[
'idAccount' => 1,
'idUser' => 1
]
);
$customer = Customer::findOne(5559);
$contractForm->customer = $customer;
$contractForm->payment_method = Transfer::PAYMENT_METHOD_TRANSFER;
$contractForm->ticketType = TicketType::find()->andWhere(['status' => TicketType::STATUS_ACTIVE ,'installment_enabled' => '1'])->one();
$start = new \DateTime();
$startString = $start->format("'Y-m-d");
$contractForm->make();
}
}