You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
568 B
28 lines
568 B
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use CodeIgniter\Model;
|
|
|
|
class FourchettePrix extends Model
|
|
{
|
|
protected $table;
|
|
protected $primaryKey = 'id';
|
|
protected $allowedFields = ['product_id', 'prix_minimal'];
|
|
|
|
public function __construct()
|
|
{
|
|
$this->table = 'fourchette_prix';
|
|
parent::__construct();
|
|
}
|
|
|
|
public function getFourchettePrixByProductId($productId)
|
|
{
|
|
return $this->where('product_id', $productId)->first();
|
|
}
|
|
|
|
public function createFourchettePrix($data)
|
|
{
|
|
return $this->insert($data);
|
|
}
|
|
}
|