-Force update button on dashboard
This commit is contained in:
miroman-afk
2022-01-29 02:42:54 +03:00
parent da51b6ca63
commit 70f5640505
5 changed files with 183 additions and 26 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Commands;
use App\Component\Models\Dishes;
use App\Component\Models\OnlineItems;
use App\Component\Models\Terminal;
use App\Console\Commands\HRCCommand;
use App\Console\Commands\HRCCommandInterface;
@@ -11,7 +12,12 @@ class TopDishes extends HRCCommand implements HRCCommandInterface {
protected $signature = 'gettopdishes';
public function command($input, $output = null) {
$terminal = Terminal::where('soft', '=', 1)->where('is_active', '=', 1)->first();
if ($terminal) {
$terminalKey = $terminal['key'];
} else {
$terminalKey = 0;
}
$info = OnlineItems::where('menu_code', '>', 0)->get()->unique('menu_code');
$count = OnlineItems::where('menu_code', '>', 0)->count();
if ($count > 0) {
@@ -58,7 +64,7 @@ class TopDishes extends HRCCommand implements HRCCommandInterface {
return [
'status' => 'success',
'dishes' => $sorted,
// 'info' => $info,
'terminal' => $terminalKey,
// 'test' => $dishes,
// 'count' => $dishCount,
];
@@ -66,7 +72,7 @@ class TopDishes extends HRCCommand implements HRCCommandInterface {
return [
'status' => 'success',
'dishes' => [],
// 'info' => $info,
'terminal' => $terminalKey,
// 'test' => $dishes,
// 'count' => $dishCount,
];