Fix models database calls and structural updates
This commit is contained in:
@@ -13,15 +13,15 @@ class Campaign extends BaseModel
|
||||
/**
|
||||
* Get all campaigns for a company
|
||||
*/
|
||||
public function findAllByCompany(int $companyId)
|
||||
public static function findAllByCompany(int $companyId)
|
||||
{
|
||||
return $this->db->query(
|
||||
return \App\Core\Database::select(
|
||||
"SELECT c.*, g.name as group_name, t.name as template_name
|
||||
FROM {$this->table} c
|
||||
FROM " . static::$table . " c
|
||||
LEFT JOIN contact_groups g ON c.group_id = g.id
|
||||
LEFT JOIN templates t ON c.template_id = t.id
|
||||
WHERE c.company_id = ? ORDER BY c.id DESC",
|
||||
[$companyId]
|
||||
)->fetchAll();
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user