fix(tahesab): do not 500 pending-summary when tahesab table is missing
Gholaktala has no local tahesab table; count queries now return empty pending stats instead of QueryException. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -8,6 +8,7 @@ use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use App\Models\Tahesab;
|
||||
use App\Models\Customer;
|
||||
use App\Services\AccountingProductDocMapper;
|
||||
@@ -44,6 +45,10 @@ class TahesabController extends Controller
|
||||
|
||||
public function table(Request $request)
|
||||
{
|
||||
if (! Schema::hasTable('tahesab')) {
|
||||
return response()->json([]);
|
||||
}
|
||||
|
||||
$view = (string) $request->input('view', 'all');
|
||||
$query = Tahesab::with('customer')->orderByDesc('id');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user