27 lines
875 B
PHP
Executable File
27 lines
875 B
PHP
Executable File
<?php
|
|
namespace App\Models;
|
|
use CodeIgniter\Model;
|
|
class ServicesModel extends Model
|
|
{
|
|
protected $table = 'services';
|
|
protected $primaryKey = 'service_id';
|
|
protected $allowedFields = ['service_id','branch_id','category','service_name','wg_labour_cost','cgst','sgst','wg_price','wog_price','tax','wog_labour_cost','description','makes_id','models_id','product_id','sub_service_id','isactive','cubic_capacity_id'];
|
|
|
|
public function getTax()
|
|
{
|
|
// Get a database instance
|
|
$db = \Config\Database::connect();
|
|
|
|
// Query the tax table
|
|
$query = $db->table('tax')->get();
|
|
|
|
// Check if query returned results
|
|
if ($query->resultID->num_rows > 0) {
|
|
return $query->getResultArray();
|
|
} else {
|
|
return []; // Return an empty array if no tax data found
|
|
}
|
|
}
|
|
|
|
|
|
} |