Русское сообщество разработки на PHP-фреймворке Laravel.
Ты не вошёл. Вход тут.
Страницы 1
Привет , не могу понять в чем проблема , может вы сможете указать на ошибку. Есть подключение к БД (Оракл) .
$sql_str = "select q1.datetime Month , q1.tsum Sum2015 , q2.tsum2 Sum2014, (q1.tsum-q2.tsum2) difsum , (q1.tsum/q2.tsum2)*100-100 difpers, q3.tcheck Count2015, q4.tcheck Count2014, (q3.tcheck-q4.tcheck) difcount,(q3.tcheck/q4.tcheck)*100-100 difpers ,q5.avgsum Avg2015, q6.avgsum Avg2014 , (q5.avgsum-q6.avgsum),(q5.avgsum/q6.avgsum)*100-100 , q7.discount DisCountToday , q8.discount DisCountPrev, (q7.discount-q8.discount),(q7.discount/q8.discount)*100-100 from (select to_char(smc.printtime,'DD.MM') datetime , sum(smc.totalsum) tsum from smcashchecks smc where locid=2 and to_char(smc.printtime,'DD.MM.YYYY') between to_date('2017-03-01','YYYY.MM.DD') and to_date('2017-03-03','YYYY.MM.DD') and smc.opcode = 1 group by to_char(printtime,'DD.MM')) q1 left join (select to_char(smc1.printtime,'DD.MM') datetime , sum(smc1.totalsum) tsum2 from smcashchecks smc1 where locid=2 and to_char(smc1.printtime,'DD.MM.YYYY') between to_date('2016-03-01','YYYY.MM.DD') and to_date('2016-03-03','YYYY.MM.DD') and smc1.opcode = 1 group by to_char(printtime,'DD.MM')) q2 on q1.datetime = q2.datetime left join (select to_char(smc2.printtime,'DD.MM') datetime , count(smc2.checknum) tcheck from smcashchecks smc2 where locid=2 and to_char(smc2.printtime,'DD.MM.YYYY') between to_date('2017-03-01','YYYY.MM.DD') and to_date('2017-03-03','YYYY.MM.DD') and smc2.opcode = 1 group by to_char(printtime,'DD.MM')) q3 on q1.datetime = q3.datetime left join (select to_char(smc2.printtime,'DD.MM') datetime , count(smc2.checknum) tcheck from smcashchecks smc2 where locid=2 and to_char(smc2.printtime,'DD.MM.YYYY') between to_date('2016-03-01','YYYY.MM.DD') and to_date('2016-03-03','YYYY.MM.DD') and smc2.opcode = 1 group by to_char(printtime,'DD.MM')) q4 on q1.datetime = q4.datetime left join (select to_char(smc2.printtime,'DD.MM') datetime , avg(totalsum) avgsum from smcashchecks smc2 where locid=2 and to_char(smc2.printtime,'DD.MM.YYYY') between to_date('2017-03-01','YYYY.MM.DD') and to_date('2017-03-03','YYYY.MM.DD') and smc2.opcode = 1 group by to_char(printtime,'DD.MM')) q5 on q1.datetime = q5.datetime left join (select to_char(smc2.printtime,'DD.MM') datetime , avg(totalsum) avgsum from smcashchecks smc2 where locid=2 and to_char(smc2.printtime,'DD.MM.YYYY') between to_date('2016-03-01','YYYY.MM.DD') and to_date('2016-03-03','YYYY.MM.DD') and smc2.opcode = 1 group by to_char(printtime,'DD.MM')) q6 on q1.datetime = q6.datetime left join (select to_char(smc.printtime,'DD.MM') datetime , count(smc.checknum) discount from smcashchecks smc , smcashdisccard smd where smc.locid = 2 and to_char(smc.printtime,'DD.MM.YYYY') between to_date('2017-03-01','YYYY.MM.DD') and to_date('2017-03-03','YYYY.MM.DD') and smc.desknum=smd.desknum and smc.znum=smd.znum and smc.checknum=smd.checknum and smd.code is not null group by to_char(smc.printtime,'DD.MM')) q7 on q1.datetime = q7.datetime left join (select to_char(smc.printtime,'DD.MM') datetime , count(smc.checknum) discount from smcashchecks smc , smcashdisccard smd where smc.locid = 2 and to_char(smc.printtime,'DD.MM.YYYY') between to_date('2016-03-01','YYYY.MM.DD') and to_date('2016-03-03','YYYY.MM.DD') and smc.desknum=smd.desknum and smc.znum=smd.znum and smc.checknum=smd.checknum and smd.code is not null group by to_char(smc.printtime,'DD.MM')) q8 on q1.datetime = q8.datetime order by q1.datetime";
Сам скрипт работает если через PLSql запустить все выводит . Но если делаю через laravel
$result = Db::connection('oracle14')->select($sql_str) ;
Результат нулевой , просто пусто . При этом если обращаюсь так же с другим скриптом полегче , скажем выборка из одной таблицы , все выводит . Например так
$result = Db::connection('oracle14')->select('select * from smcard') ;
Не в сети
я думал оракла из ларавеля уже давно выпилили. или это через какой-то пакет работает?
Не в сети
Пакет yajra\laravel-oci8
Не в сети
Короче эта гадость не есть ссылки в скриптах .
Не в сети
Страницы 1