v.2.11
-Force update button on dashboard
This commit is contained in:
@@ -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,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user