View difference between Paste ID: qf2ZnAs9 and s2S6gA5n
SHOW: | | - or go back to the newest paste.
1
   /**
2
    * @param int advisors id
3
    * @return array
4
    * @final
5
    */
6
    final public function getClients($advisors = null) {
7
        $fluent = $this->db->select("*")
8-
                           ->select("CONCAT_WS(' ', titul, prijmeni, jmeno) AS nazevKlienta")
8+
                           ->select("IFNULL(CONCAT_WS(' ', titul, prijmeni, jmeno), nazevSpolecnosti) AS klient")
9-
                           ->select("CONCAT_WS(' ', nazevSpolecnosti) AS nazevSpol")
9+
10-
                           ->select("IFNULL(nazevKlienta, nazevSpol) AS klient")
10+
11
            $fluent->where("poradce = %i", $advisors);   
12
        return $fluent->OrderBy("zalozen DESC")->fetchPairs("id", "klient");            
13
    }
14
15
16
// a píše mi to chybu Unknown column 'nazevKlienta' in 'field list'