chart fixed
This commit is contained in:
@@ -31,12 +31,12 @@ class PriceSyncLogController extends Controller
|
||||
|
||||
public function runSync(LivePriceTickService $tickService)
|
||||
{
|
||||
$tickService->tick();
|
||||
|
||||
$log = PriceSyncLog::with('items')->orderByDesc('id')->first();
|
||||
$log = $tickService->tick();
|
||||
|
||||
return response()->json([
|
||||
'message' => $log ? 'قیمتها بهروزرسانی شد' : 'همگامسازی انجام شد',
|
||||
'message' => $log
|
||||
? 'قیمتها بهروزرسانی شد'
|
||||
: 'قیمت تغییری نکرد؛ رکورد جدیدی ثبت نشد',
|
||||
'data' => $log,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ use App\Services\ConfigService;
|
||||
use App\Services\ProductDisplayPriceService;
|
||||
use App\Services\ProductPriceService;
|
||||
use App\Services\ProductPriceSyncService;
|
||||
use App\Services\PriceBroadcastService;
|
||||
use App\Services\CategoryService;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
@@ -251,6 +252,10 @@ class ProductController extends SuperController
|
||||
app(ProductPriceSyncService::class)->syncAll(true);
|
||||
}
|
||||
|
||||
dispatch(function () {
|
||||
app(PriceBroadcastService::class)->broadcastAfterPriceUpdate();
|
||||
})->afterResponse();
|
||||
|
||||
return response()->json(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user