maximP Posted September 18, 2015 Share Posted September 18, 2015 (edited) $data = array( ... on 718 '{shift}' => $this::getShiftFromOrderForEmail($order->id), .... public static function getShiftFromOrderForEmail($id_order){$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('select s.time_fromfrom `'._DB_PREFIX_.'shift` as sjoin `'._DB_PREFIX_.'1c_orders` as c on c.id_shift = s.id_shiftjoin `'._DB_PREFIX_.'orders` as o on o.id_order = c.id_orderwhere o.id_order = '.(int)$id_order );$res2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('select s.time_from, s.time_tofrom ps_shift as sjoin ps_1c_orders as c on c.id_shift = s.id_shiftjoin ps_orders as o on o.id_cart = c.id_cwhere o.id_order = 555' ); WORK!!!$sql = new DbQuery();$sql->select('CONCAT(s.time_from, " - " ,s.time_to )');$sql->from('shift','s');$sql->innerJoin('1c_orders', 'c' , 'c.id_shift = s.id_shift')$sql->innerJoin('orders', 'o' , 'o.id_order = c.id_order')$sql->where('o.id_order = '.(int)$id_order);$result = Db::getInstance()->getRow($sql);Db::getInstance()->getMsgError(); return $result ? $result : 'none';} Problem: none of these requests can not give the required information. I tried to whether the value comes to $id_order - it comes. Text output, return it through output. But I needed a request is not working. Help! Edited September 18, 2015 by maximP (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now