public function changeStatus(DtoOutlets $outlet) { $this->db->set('updated_date', date('Y-m-d H:i:s')); $this->db->set('updated_by', $this->ion_auth->get_user_id()); $this->db->set('status', 1 - $outlet->getStatus()); $this->db->where('id', $outlet->getId()); return $this->db->update('outlets'); }
public function updateOutlet(DtoOutlets $dto) { $outlet = array("dms_code" => $dto->getDms_code(), "distributor" => $dto->getDistributor(), "channel_id" => $dto->getChannel_id(), "outlet_type_id" => $dto->getOutlet_type_id(), "name" => $dto->getName(), "address" => $dto->getAddress(), "ba_id" => $dto->getBa_id(), "updated_by" => $dto->getUpdated_by()); $this->db->set('updated_date', 'NOW()', FALSE); $this->db->set('status', TRUE); $this->db->where('id', $dto->getId()); return $this->db->update('outlets', $outlet); }