You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.8 KiB
PHP

<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\Customer;
use App\Models\DepositHistory;
use App\Models\PaylaterHistory;
use App\Models\PaylaterTenorHistory;
use App\Models\Sale;
class CustomerHistoryController extends Controller
{
public function deposit(Customer $customer)
{
$query = DepositHistory::with(['editor'])
->where('customer_id', $customer->id)
->orderBy('created_at', 'desc');
return inertia('CustomerHistory/DepositHistory', [
'query' => $query->paginate(),
'customer' => $customer,
]);
}
public function sale(Customer $customer)
{
$query = Sale::where('customer_id', $customer->id)
->orderBy('created_at', 'desc');
return inertia('CustomerHistory/SaleHistory', [
'query' => $query->paginate(),
'customer' => $customer,
]);
}
public function paylater()
{
}
public function paylater_limit(Customer $customer)
{
$query = PaylaterHistory::with(['creator'])
->where('type', PaylaterHistory::TYPE_UPGRADE)
->where('customer_id', $customer->id)
->orderBy('created_at', 'desc');
return inertia('CustomerHistory/PaylaterLimitHistory', [
'query' => $query->paginate(),
'customer' => $customer,
]);
}
public function paylater_deadline(Customer $customer)
{
$query = PaylaterTenorHistory::with(['creator'])
->where('customer_id', $customer->id)
->orderBy('created_at', 'desc');
return inertia('CustomerHistory/PaylaterTenorHistory', [
'query' => $query->paginate(),
'customer' => $customer,
]);
}
}