27 lines
750 B
PHP
27 lines
750 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Controllers\Api\Admin;
|
||
|
|
|
||
|
|
use App\Http\Controllers\Controller;
|
||
|
|
use App\Models\Boards\Board;
|
||
|
|
use Illuminate\Http\Request;
|
||
|
|
use Illuminate\View\View;
|
||
|
|
|
||
|
|
class CustomerCenterController extends Controller
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* 고객센터 게시판 목록 (활성화된 시스템 게시판만 + 게시글 수)
|
||
|
|
*/
|
||
|
|
public function index(Request $request): View
|
||
|
|
{
|
||
|
|
$boards = Board::query()
|
||
|
|
->whereNull('tenant_id') // 시스템 게시판만
|
||
|
|
->where('is_active', true) // 활성화된 것만
|
||
|
|
->withCount('posts') // 게시글 수
|
||
|
|
->orderBy('created_at', 'desc')
|
||
|
|
->paginate(15);
|
||
|
|
|
||
|
|
return view('customer-center.partials.table', compact('boards'));
|
||
|
|
}
|
||
|
|
}
|