Add waste
This commit is contained in:
43
console/controllers/DetstaConsoleController.php
Normal file
43
console/controllers/DetstaConsoleController.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user