mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-01-25 09:48:02 -05:00
36 lines
624 B
PHP
36 lines
624 B
PHP
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
/**
|
|
* Rewards class
|
|
*
|
|
* @link github.com/jekkos/opensourcepos
|
|
* @since 3.1
|
|
* @author joshua1234511
|
|
*/
|
|
|
|
class Rewards extends CI_Model
|
|
{
|
|
/*
|
|
Inserts or updates a rewards
|
|
*/
|
|
public function save(&$rewards_data, $id = -1)
|
|
{
|
|
if($id == -1 || !$this->exists($id))
|
|
{
|
|
if($this->db->insert('sales_reward_points', $rewards_data))
|
|
{
|
|
$rewards_data['id'] = $this->db->insert_id();
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
$this->db->where('id', $id);
|
|
|
|
return $this->db->update('sales_reward_points', $rewards_data);
|
|
}
|
|
}
|
|
?>
|