This commit is contained in:
2026-07-12 19:21:35 +02:00
parent f2d944b117
commit 41cb412cb0
49 changed files with 3170 additions and 52 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class ReceiptItemModel extends Model
{
protected $table = 'receipt_items';
protected $primaryKey = 'id';
protected $returnType = 'array';
protected $useTimestamps = true;
protected $allowedFields = [
'receipt_id', 'name', 'display_name', 'qty', 'amount',
'suggested_category_id', 'chosen_category_id',
];
/**
* Pozycje danego paragonu w kolejnosci wprowadzenia.
*/
public function forReceipt(int $receiptId): array
{
return $this->where('receipt_id', $receiptId)
->orderBy('id', 'ASC')
->findAll();
}
}