v.2.22
Редактор карты зала Электронные заказы Отчет по удалениям
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddColumnsToOrderItem extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
|
||||
if (!Schema::hasColumn('order_items', 'is_deleted')) {
|
||||
Schema::table('order_items', function (Blueprint $table) {
|
||||
$table->tinyInteger('is_deleted')->nullable()->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::table('order_items', function (Blueprint $table) {
|
||||
$table->dropColumn('is_deleted');
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class UpdateItemCountAndItemPriceInOrderItemsToFloat extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
if (!Schema::hasColumn('order_items', 'item_price')) {
|
||||
Schema::table('order_items', function (Blueprint $table) {
|
||||
$table->decimal('item_price', $precision = 16, $scale = 3)->nullable();
|
||||
});
|
||||
}
|
||||
if (!Schema::hasColumn('order_items', 'item_count')) {
|
||||
Schema::table('order_items', function (Blueprint $table) {
|
||||
$table->decimal('item_count', $precision = 16, $scale = 2)->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::table('order_items', function (Blueprint $table) {
|
||||
$table->integer('item_price')->nullable()->change();
|
||||
});
|
||||
Schema::table('order_items', function (Blueprint $table) {
|
||||
$table->integer('item_count')->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class UpdateTotalPriceInOrdersToFloat extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
if (!Schema::hasColumn('orders', 'total_price')) {
|
||||
Schema::table('orders', function (Blueprint $table) {
|
||||
$table->decimal('total_price', $precision = 16, $scale = 2)->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::table('orders', function (Blueprint $table) {
|
||||
$table->integer('total_price')->nullable()->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePlacesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if (!Schema::hasTable('places')) {
|
||||
Schema::create('places', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('name');
|
||||
$table->integer('place_id');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('places');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePlaceTablesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if (!Schema::hasTable('place_tables')) {
|
||||
Schema::create('place_tables', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->bigInteger('place_id')->unsigned();
|
||||
$table->foreign('place_id')->references('id')->on('places')->onDelete('cascade');
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
if (!Schema::hasColumn('place_tables', 'table_id')) {
|
||||
Schema::table('place_tables', function (Blueprint $table) {
|
||||
$table->integer('table_id')->nullable();
|
||||
});
|
||||
}
|
||||
if (!Schema::hasColumn('place_tables', 'width')) {
|
||||
Schema::table('place_tables', function (Blueprint $table) {
|
||||
$table->decimal('width', $precision = 10, $scale = 6)->nullable();
|
||||
});
|
||||
}
|
||||
if (!Schema::hasColumn('place_tables', 'height')) {
|
||||
Schema::table('place_tables', function (Blueprint $table) {
|
||||
$table->decimal('height', $precision = 10, $scale = 6)->nullable();
|
||||
});
|
||||
}
|
||||
if (!Schema::hasColumn('place_tables', 'x')) {
|
||||
Schema::table('place_tables', function (Blueprint $table) {
|
||||
$table->decimal('x', $precision = 10, $scale = 6)->nullable();
|
||||
});
|
||||
}
|
||||
if (!Schema::hasColumn('place_tables', 'y')) {
|
||||
Schema::table('place_tables', function (Blueprint $table) {
|
||||
$table->decimal('y', $precision = 10, $scale = 6)->nullable();
|
||||
});
|
||||
}
|
||||
if (!Schema::hasColumn('place_tables', 'type')) {
|
||||
Schema::table('place_tables', function (Blueprint $table) {
|
||||
$table->integer('type')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('place_tables');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class UpdateCoreInterface extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
function deleteFolder($dir) {
|
||||
$d = opendir($dir);
|
||||
while (($entry = readdir($d)) !== false) {
|
||||
if ($entry != "." && $entry != "..") {
|
||||
if (is_dir($dir . "/" . $entry)) {
|
||||
deleteFolder($dir . "/" . $entry);
|
||||
} else {
|
||||
unlink($dir . "/" . $entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($d);
|
||||
rmdir($dir);
|
||||
}
|
||||
$directivesUpd = CORE_PATH . '/../V1/forUpdate/toDirectives/';
|
||||
$indexUpd = CORE_PATH . '/../V1/forUpdate/toWebApp/';
|
||||
if (is_dir($directivesUpd)) {
|
||||
$files = array_diff(scandir($directivesUpd), array('.', '..'));
|
||||
foreach ($files as $file) {
|
||||
if (file_exists(CORE_PATH . '/../../web/app/scripts/directives/' . $file)) {
|
||||
copy(CORE_PATH . '/../../web/app/scripts/directives/' . $file, CORE_PATH . '/../../web/app/scripts/directives/' . $file . '.bak');
|
||||
}
|
||||
copy($directivesUpd . $file, CORE_PATH . '/../../web/app/scripts/directives/' . $file);
|
||||
}
|
||||
}
|
||||
if (is_dir($indexUpd)) {
|
||||
$files = array_diff(scandir($indexUpd), array('.', '..'));
|
||||
foreach ($files as $file) {
|
||||
if (file_exists(CORE_PATH . '/../../web/app/' . $file)) {
|
||||
copy(CORE_PATH . '/../../web/app/' . $file, CORE_PATH . '/../../web/app/' . $file . '.bak');
|
||||
}
|
||||
copy($indexUpd . $file, CORE_PATH . '/../../web/app/' . $file);
|
||||
}
|
||||
}
|
||||
if (file_exists(CORE_PATH . '/../V1/forUpdate/')) {
|
||||
deleteFolder(CORE_PATH . '/../V1/forUpdate/');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
33
database/seeders/AddStaffRights.php
Normal file
33
database/seeders/AddStaffRights.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Component\Seeders;
|
||||
|
||||
use App\Component\Models\Right;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class AddStaffRights extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
if (Right::where('code', 'clean')->count() == 0) {
|
||||
Right::add('clean', 'Обрезка базы');
|
||||
}
|
||||
if (Right::where('code', 'marketplace')->count() == 0) {
|
||||
Right::add('marketplace', 'Маркетплейс');
|
||||
}
|
||||
if (Right::where('code', 'update')->count() == 0) {
|
||||
Right::add('update', 'Обновления');
|
||||
}
|
||||
if (Right::where('code', 'roommap')->count() == 0) {
|
||||
Right::add('roommap', 'Карта залов');
|
||||
}
|
||||
if (Right::where('code', 'eorders')->count() == 0) {
|
||||
Right::add('eorders', 'Онлайн заказы');
|
||||
}
|
||||
}
|
||||
}
|
||||
33
database/seeders/AddUserRights.php
Normal file
33
database/seeders/AddUserRights.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Component\Seeders;
|
||||
|
||||
use App\Component\Models\StaffRights;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class AddUserRights extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
if (StaffRights::where('code', 'RIGHT_57')->count() == 0) {
|
||||
StaffRights::add('RIGHT_57', 'Доставка');
|
||||
}
|
||||
if (StaffRights::where('code', 'RIGHT_58')->count() == 0) {
|
||||
StaffRights::add('RIGHT_58', 'Электронный чек');
|
||||
}
|
||||
if (StaffRights::where('code', 'RIGHT_59')->count() == 0) {
|
||||
StaffRights::add('RIGHT_59', 'Отображение заказов в журнале');
|
||||
}
|
||||
if (StaffRights::where('code', 'RIGHT_60')->count() == 0) {
|
||||
StaffRights::add('RIGHT_60', 'Отображение отчетов смены');
|
||||
}
|
||||
if (StaffRights::where('code', 'RIGHT_61')->count() == 0) {
|
||||
StaffRights::add('RIGHT_61', 'Печать копии чека из журнала заказов');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user