feat: initial scaffold with component, system plugin, and webservices plugin
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
namespace Moko\Component\MokoSuiteField\Administrator\Model;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
|
||||
|
||||
class VehiclesModel extends BaseDatabaseModel
|
||||
{
|
||||
public function getItems(string $status = '', int $techId = 0, int $limit = 50): array
|
||||
{
|
||||
$db = $this->getDatabase();
|
||||
$query = $db->getQuery(true)
|
||||
->select('v.*, cd.name AS tech_name')
|
||||
->from($db->quoteName('#__mokosuitefield_vehicles', 'v'))
|
||||
->join('LEFT', $db->quoteName('#__mokosuitefield_technicians', 't') . ' ON t.id = v.technician_id')
|
||||
->join('LEFT', $db->quoteName('#__contact_details', 'cd') . ' ON cd.id = t.contact_id')
|
||||
->order('v.vehicle_name ASC');
|
||||
|
||||
if ($status) $query->where($db->quoteName('v.status') . ' = ' . $db->quote($status));
|
||||
if ($techId) $query->where('v.technician_id = ' . $techId);
|
||||
|
||||
$db->setQuery($query, 0, $limit);
|
||||
return $db->loadObjectList() ?: [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user