Subversion-Projekte lars-tiefland.ci

Revision

Revision 1822 | Revision 1824 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 1822 Revision 1823
Zeile 3... Zeile 3...
3
/**
3
/**
4
 *
4
 *
5
 * @package WebanOS CI
5
 * @package WebanOS CI
6
 * @author Lars Tiefland <ltiefland@gmail.com> 
6
 * @author Lars Tiefland <ltiefland@gmail.com> 
7
 * @copyright 2016
7
 * @copyright 2016
8
 * @version $Rev: 1822 $
8
 * @version $Rev: 1823 $
9
 */
9
 */
Zeile 10... Zeile 10...
10
 
10
 
11
/**
11
/**
12
 * Auspraegung_model
12
 * Auspraegung_model
13
 * 
13
 * 
14
 * @package WebanOS CI
14
 * @package WebanOS CI
15
 * @author Lars Tiefland
15
 * @author Lars Tiefland
16
 * @copyright 2016
16
 * @copyright 2016
17
 * @version $Id: Artikel_to_auspraegung_model.php 1822 2016-12-18 19:46:19Z lars $
17
 * @version $Id: Artikel_to_auspraegung_model.php 1823 2016-12-21 18:51:55Z lars $
18
 * @access public
18
 * @access public
19
 */
19
 */
20
class Artikel_to_auspraegung_model extends CI_Model
20
class Artikel_to_auspraegung_model extends CI_Model
21
{
21
{
Zeile 34... Zeile 34...
34
	 * 
34
	 * 
35
	 * @return
35
	 * @return
36
	 */
36
	 */
37
	public function get_list($artikel)
37
	public function get_list($artikel)
38
	{
38
	{
39
		$sql = "SELECT
39
		$sql = "SELECT DISTINCT
40
				id
40
				auspraegung AS id
41
			FROM
41
			FROM
42
				artikel_to_auspraegung
42
				artikel_to_auspraegung
43
			WHERE
43
			WHERE
44
				artikel=".$artikel."
44
				artikel=".$artikel."
45
		";
45
		";
Zeile 60... Zeile 60...
60
	 * @return
60
	 * @return
61
	 */
61
	 */
62
	private function get($id)
62
	private function get($id)
63
	{
63
	{
64
		$sql = "SELECT
64
		$sql = "SELECT
65
				ata.*,
65
				a.*,
66
				a.name,
66
				ata.wert
67
				a.type
-
 
68
			FROM
67
			FROM
69
				artikel_to_auspraegung ata
68
				artikel_to_auspraegung ata
70
			JOIN
69
			JOIN
71
				auspraegung a
70
				auspraegung a
72
			ON
71
			ON
Zeile 75... Zeile 74...
75
				ata.id=".$id."
74
				ata.id=".$id."
76
			ORDER BY
75
			ORDER BY
77
				auspraegung
76
				auspraegung
78
		";
77
		";
79
		$res = $this->db->query($sql);
78
		$res = $this->db->query($sql);
-
 
79
		$werte = array();
80
		$row = $res->unbuffered_row('array');
80
		while ($row = $res->unbuffered_row('array'))
-
 
81
		{
-
 
82
			$werte[] = $row["wert"];
-
 
83
		}
-
 
84
		unset($row["wert"]);
-
 
85
		$row["werte"] = $werte;
81
		return $row;
86
		return $row;
82
	}
87
	}
83
}
88
}
Zeile 84... Zeile 89...
84
 
89
 
85
?>
90
?>