a
This commit is contained in:
@@ -18,22 +18,20 @@ use Illuminate\Validation\Rule;
|
|||||||
#[Group('Sargytlar - Kart - Kart hereketleri')]
|
#[Group('Sargytlar - Kart - Kart hereketleri')]
|
||||||
class CardTransactionsController extends Controller
|
class CardTransactionsController extends Controller
|
||||||
{
|
{
|
||||||
public function quick(Request $request)
|
/**
|
||||||
|
* This month transactions on card
|
||||||
|
*/
|
||||||
|
public function lastMonth(): JsonResponse
|
||||||
{
|
{
|
||||||
$data = $request->validate([
|
|
||||||
'start_date' => ['required', 'string', 'date'],
|
|
||||||
'end_date' => ['required', 'string', 'date', 'after:start_date'],
|
|
||||||
]);
|
|
||||||
|
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
|
|
||||||
$start_date = Carbon::create($data['start_date'])->format('d.m.Y');
|
$start_date = today()->startOfMonth()->format('d.m.Y');
|
||||||
$end_date = Carbon::create($data['end_date'])->format('d.m.Y');
|
$end_date = today()->endOfMonth()->format('d.m.Y');
|
||||||
$passport_serie = $this->getOption('passport_serie');
|
$passport_serie = $user->getOption('passport_serie');
|
||||||
$passport_id = $this->getOption('passport_id');
|
$passport_id = $user->getOption('passport_id');
|
||||||
$card_number = $this->getOption('card_number');
|
$card_number = $user->getOption('card_number');
|
||||||
$card_month = $this->getOption('card_month');
|
$card_month = $user->getOption('card_month');
|
||||||
$card_year = $this->getOption('card_year');
|
$card_year = $user->getOption('card_year');
|
||||||
|
|
||||||
if (
|
if (
|
||||||
is_null($passport_serie) || $passport_serie === '' ||
|
is_null($passport_serie) || $passport_serie === '' ||
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ Route::middleware(['auth:sanctum', 'not_banned'])->group(function () {
|
|||||||
Route::delete('card-order/{cardOrder}', [CardOrderController::class, 'destroy']);
|
Route::delete('card-order/{cardOrder}', [CardOrderController::class, 'destroy']);
|
||||||
|
|
||||||
// Card transactions... [tested fully]
|
// Card transactions... [tested fully]
|
||||||
Route::get('card-transactions-quick', [CardTransactionsController::class, 'quick']);
|
Route::get('card-transactions-last-month', [CardTransactionsController::class, 'lastMonth']);
|
||||||
Route::get('card-transactions', [CardTransactionsController::class, 'index']);
|
Route::get('card-transactions', [CardTransactionsController::class, 'index']);
|
||||||
Route::get('card-transactions/{order}', [CardTransactionsController::class, 'show']);
|
Route::get('card-transactions/{order}', [CardTransactionsController::class, 'show']);
|
||||||
Route::get('card-transactions-download/{order}', [CardTransactionsController::class, 'download']);
|
Route::get('card-transactions-download/{order}', [CardTransactionsController::class, 'download']);
|
||||||
|
|||||||
Reference in New Issue
Block a user