add inventory daily
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace console\controllers;
|
||||
|
||||
use backend\components\InventoryManager;
|
||||
use common\models\Inventory;
|
||||
use common\models\InventoryItem;
|
||||
use common\models\Transfer;
|
||||
@@ -63,6 +64,18 @@ class InventoryConsoleController extends Controller{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Inventory model.
|
||||
* If creation is successful, the browser will be redirected to the 'view' page.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionCreate()
|
||||
{
|
||||
$inventoryManager = new InventoryManager();
|
||||
$inventoryManager->generateDaily();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Schema;
|
||||
use yii\db\Migration;
|
||||
|
||||
class m170324_064243_alter_table_inventory_add_column_type extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn("inventory", "type", "int default 1");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m170324_064243_alter_table_inventory_add_column_type cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
||||
Reference in New Issue
Block a user