fix skit2

This commit is contained in:
fifi97
2021-06-14 11:19:55 +08:00
12 changed files with 339 additions and 33 deletions
+4 -7
View File
@@ -37,14 +37,11 @@ class GlejerController extends Controller
public function Getglejer_Data($tarikh1,$tarikh2,$kodcaw)
{
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$glejer=Glejer::on($cawangan['mysql'])->whereBetween('tarikh',[$tarikh1,$tarikh2])->orderBy('glcode','ASC')->get();
return response()->json($glejer);
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$db=$cawangan['mysql'];
$glejer=DB::connection($db)->select("SELECT glcode, descpt , SUM(debit)AS total_debit, SUM(kredit) AS total_kredit, SUM(hariini) AS totalharini FROM glejer where tarikh BETWEEN '".$tarikh1."' and '".$tarikh2."' GROUP BY glcode,descpt ORDER BY glcode asc");
return response()->json($glejer);
}