<?php

namespace App\Models;

use CodeIgniter\Model;

class Qcitem extends Model
{
    protected $table = 'qc_daily'; // Nama tabel
    protected $primaryKey = 'id'; // Jika primary key tidak 'id', sesuaikan di sini
    protected $allowedFields = ['order_id', 'qc_code', 'item_code', 'hasilqc', 'reject', 'date_time'];

    public function getby($id)
    {

            if ($id) {
                return $this->where('order_id', $id)
                ->findAll();
            } else {
                return $this->orderBy('order_id', 'DESC')->findAll();
            }

    }
}