fix(shayegan): return the document list in the shared table shape
The admin table expects rows and query from TableEngine instead of a custom page payload. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
- YYYY-MM-DD | موضوع | مسیر فایل(ها) | نکتهٔ ۱ خطی
|
- YYYY-MM-DD | موضوع | مسیر فایل(ها) | نکتهٔ ۱ خطی
|
||||||
|
|
||||||
- 2026-11-02 | جدول اسناد شایگان | `shayeganTable.vue` + `ShayeganController::table` | BaseTable؛ پاسخ بدون `query` را خود فرانت به `{rows,query}` برمیگرداند. ستون عملیات `ops` است تا در RTL هشدار fixed ندهد
|
- 2026-11-02 | جدول اسناد شایگان | `shayeganTable.vue` + `ShayeganController::table` | BaseTable؛ پاسخ بدون `query` را خود فرانت به `{rows,query}` برمیگرداند. ستون عملیات `ops` است تا در RTL هشدار fixed ندهد
|
||||||
|
- 2026-11-02 | ویرایش کد حسابداری شایگان | `CustomerAccountingCodeModal.vue` | provider شایگان هم `moshtari_code` ذخیره میکند؛ قبلاً فقط پرگار/تهحساب/زرین قبول میشد و پیام «حسابداری فعال نیست» میآمد
|
||||||
- 2026-11-02 | مشتری تفصیلی شناور | `ShayeganSyncService::registerCustomer` → `Job/Put` | معین 12101 حساب جدا نمیسازد؛ `JobNumber` = معین+کد (`12101530`). گروه: setting `shayegan_job_group`
|
- 2026-11-02 | مشتری تفصیلی شناور | `ShayeganSyncService::registerCustomer` → `Job/Put` | معین 12101 حساب جدا نمیسازد؛ `JobNumber` = معین+کد (`12101530`). گروه: setting `shayegan_job_group`
|
||||||
- 2026-11-02 | دیباگ تبادل شایگان | `ShayeganClient::request` + `registerCustomer` / health / retry | پاسخ ادمین `client_request` و `server_response` دارد؛ رمز DB و Auth برابر `***`
|
- 2026-11-02 | دیباگ تبادل شایگان | `ShayeganClient::request` + `registerCustomer` / health / retry | پاسخ ادمین `client_request` و `server_response` دارد؛ رمز DB و Auth برابر `***`
|
||||||
- 2026-11-02 | سه سطح شایگان | `ShayeganSyncService::registerCustomer` + migration `2026_11_02_000001` | کل 121، معین `12101`، تفصیلی = معین+کد کاربری (`12101530`). `1210101` غلط است
|
- 2026-11-02 | سه سطح شایگان | `ShayeganSyncService::registerCustomer` + migration `2026_11_02_000001` | کل 121، معین `12101`، تفصیلی = معین+کد کاربری (`12101530`). `1210101` غلط است
|
||||||
|
|||||||
@@ -76,26 +76,25 @@ class ShayeganController extends Controller
|
|||||||
public function table(Request $request)
|
public function table(Request $request)
|
||||||
{
|
{
|
||||||
if (! Schema::hasTable('shayegan')) {
|
if (! Schema::hasTable('shayegan')) {
|
||||||
return response()->json(['data' => [], 'total' => 0]);
|
return response()->json([
|
||||||
|
'rows' => [],
|
||||||
|
'query' => [
|
||||||
|
'limit' => (int) $request->input('limit', 20),
|
||||||
|
'page' => 1,
|
||||||
|
'total' => 0,
|
||||||
|
'filters' => $request->input('filters', []),
|
||||||
|
'search' => $request->input('search'),
|
||||||
|
],
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$q = Shayegan::query()->orderByDesc('id');
|
$query = Shayegan::query()->orderByDesc('id');
|
||||||
if ($request->filled('sync_status')) {
|
\App\DB\Te\TableEngine::create($query, $request)
|
||||||
$q->where('sync_status', $request->get('sync_status'));
|
->initSearch(['desc', 'type', 'shayegan_number', 'sync_status'])
|
||||||
}
|
->select(['*'])
|
||||||
if ($request->filled('type')) {
|
->export($query);
|
||||||
$q->where('type', $request->get('type'));
|
|
||||||
}
|
|
||||||
|
|
||||||
$perPage = min(100, max(10, (int) $request->get('per_page', 20)));
|
return response()->json($query);
|
||||||
$page = $q->paginate($perPage);
|
|
||||||
|
|
||||||
return response()->json([
|
|
||||||
'data' => $page->items(),
|
|
||||||
'total' => $page->total(),
|
|
||||||
'current_page' => $page->currentPage(),
|
|
||||||
'per_page' => $page->perPage(),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show($id)
|
public function show($id)
|
||||||
|
|||||||
Reference in New Issue
Block a user