Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 52.15.191.241
<?php
function getDailyValuation($aobj_context)
{
//$valuationType = $aobj_context->mobj_data['valuationType'];
$univcode = $aobj_context->mobj_data['univcode'];
$dateFrom = $aobj_context->mobj_data['dateFrom'];
$dateTo = $aobj_context->mobj_data['dateTo'];
$boardFrom = $aobj_context->mobj_data['boardFrom'];
$boardTo = $aobj_context->mobj_data['boardTo'];
$query = "select date_format(t.fdate,'%d/%m/%Y') as fdate, m.fqpcode, m.fsubname, m.fboard, b.fboardname, count(t.fpacket) as fpktcnt,
sum(t.fvcount) as fvcount, sum(frcount) as frcount
from mastabu t inner join masqp m on t.fqpcode = m.fqpcode
inner join masboard b on m.fboard = b.fboardcode
where t.fdate between date_format(str_to_date('{$dateFrom}','%d/%m/%Y'),'%Y-%m-%d') and
date_format(str_to_date('{$dateTo}','%d/%m/%Y'),'%Y-%m-%d')
and m.fboard between '{$boardFrom}' and '{$boardTo}'
group by t.fdate, m.fboard, t.fqpcode";
$result = $aobj_context->pobj_db->GetAll($query);
// var_dump($query);
if(sizeof($result)>0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
return;
}
else
{
$arr['msg'] = "No data found!";
// $errmsg = "No data found!";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}
?>
|