This commit is contained in:
Danni committed 2026-09-20 13:07:50 +07:00
1 parent 620fc5bda1
commit bd3ef9f279
779 files changed
+202868

No files matched your search

View File
Whitespace-only changes.
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class ItemModel extends model {
protected $table = 'item';
public function getItem($itemId = false) {
if ($itemId === false) {
return $this->findAll();
}
return $this->where(['itemId' => $itemId])->first();
}
public function getCount() {
return $this->db->count_all($this->table);
}
public function getStar(?int $perPage = null): array
{
$this->builder()
->select('item.*, star.star')
->join('star', 'star.itemId = item.itemId');
return [
'star' => $this->paginate($perPage),
'starpager' => $this->pager,
];
}
}