Can't obtain model's source from models list:

Hi, i have problem it said "Can't obtain model's source from models list: 'Modules\Backend\Models\LgxTransaction', when preparing: SELECT a.id, a.invoice, a.id_package, " this is my code:

__

 if ($invoice != "") {
            $where = "WHERE invoice = '".$invoice."'";
        }else{
            $where = "";
        }
        $query = ("
            SELECT 
            a.id,
            a.invoice,
            a.id_package,
            a.email,
            a.kode_voucher,
            a.harga,
            a.periode,
            a.method,
            a.status,
            a.start_date,
            a.end_date,
            a.create_login,
            a.create_date,
            b.caption as nama_package,
            b.keterangan
            FROM \Modules\Backend\Models\lgxTransaction a
            LEFT JOIN \Modules\Backend\Models\LgxMPackage b ON a.id_package = b.id
            $where
            ORDER BY a.id DESC 
            limit 100
            ");
        $row = $this->modelsManager->executeQuery($query);
        if($row->count() > 0) return $row;

__



75.3k

i am not sure but i think you need to call ->from("\MyNameSpace\ModelName") ?

$builder = $this->modelsManager->createBuilder()
                ->andWhere("created_at <= ?0", [$dt->getTimestamp()])
                ->andWhere("shown = 1")
                ->orderBy("created_at DESC")
                ->from('Blog\Models\Articles');


36.3k

Hi,

maybe typo error:

FROM \Modules\Backend\Models\lgxTransaction a

and

Can't obtain model's source from models list: 'Modules\Backend\Models\LgxTransaction



36.3k
edited 12d ago

otherwise, show \Modules\Backend\Models\LgxTransaction Model file and service defintion