Fix migrations
This commit is contained in:
miroman-afk
2023-08-10 13:16:56 +03:00
parent ed61e9627d
commit 94fef07bb2
3 changed files with 7 additions and 4 deletions

View File

@@ -2353,7 +2353,7 @@ class GETDataReport extends HRCCommand implements HRCCommandInterface
$item_staff = Staff::getName($create_action['who']);
$item_time = $create_action['time'];
$item_printer = Printer::getName(Dishes::GetPrinterCode($item_menu_code));
$item_work_place = Terminal::getNameByWorkGroup($create_action['work_group'], $create_action['work_code']);
$item_work_place = Terminal::getNameByWorkGroup(intval($create_action['work_group']), intval($create_action['work_code']));
$items_array = array(
'shift_id' => $shift_id,
'work_place' => $item_work_place,

View File

@@ -51,7 +51,9 @@ class UpdateCoreInterface230 extends Migration
if (!is_dir(CORE_PATH . '/../../web/libs/datatables/')) {
mkdir(CORE_PATH . '/../../web/libs/datatables/', 0777);
} else {
mkdir(CORE_PATH . '/../../web/libs/datatables/backup/', 0777);
if (!is_dir(CORE_PATH . '/../../web/libs/datatables/backup/')) {
mkdir(CORE_PATH . '/../../web/libs/datatables/backup/', 0777);
}
$old_files = array_diff(scandir(CORE_PATH . '/../../web/libs/datatables/'), array('.', '..'));
foreach ($old_files as $old_file) {
copy(CORE_PATH . '/../../web/libs/datatables/' . $old_file, CORE_PATH . '/../../web/libs/datatables/backup/' . $old_file);

View File

@@ -11,7 +11,7 @@ class Terminal extends Model {
{
$terminal_name = self::where('id', intval($id))
->first();
if ($terminal_name) {
if ($terminal_name && $terminal_name['name'] !== null) {
$terminal_name = $terminal_name['name'];
} else {
$terminal_name = 'Наименование рабочего места отсутствует';
@@ -23,8 +23,9 @@ class Terminal extends Model {
{
$terminal_name = self::where('work_group', intval($group_id))
->where('work_code', intval($group_code))
->where('is_active', 1)
->first();
if ($terminal_name) {
if ($terminal_name && $terminal_name['name'] !== null) {
$terminal_name = $terminal_name['name'];
} else {
$terminal_name = 'Наименование рабочего места отсутствует';