add api for all gadai by customer
This commit is contained in:
@@ -10,7 +10,7 @@ class CawanganController extends Controller
|
||||
|
||||
public function showAllCawangans()
|
||||
{
|
||||
return response()->json(Cawangan::all());
|
||||
return response()->json(Cawangan::on('mysql7')->get());
|
||||
}
|
||||
|
||||
public function showOneCawangan($code_cawangan)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Gadai;
|
||||
use App\Cawangan;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class GadaiController extends Controller
|
||||
@@ -13,9 +14,26 @@ class GadaiController extends Controller
|
||||
return response()->json(Gadai::all());
|
||||
}
|
||||
|
||||
public function showOneGadai($id)
|
||||
public function gadaiTransactionByCawanganAndDay($cawangan_code,$date){
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$cawangan_code)->first();
|
||||
|
||||
$gadaiTransaction = Gadai::on($cawangan['mysql'])->where('t_gadai','=',$date)->get();
|
||||
|
||||
return response()->json($gadaiTransaction);
|
||||
}
|
||||
|
||||
public function showOneGadai($noic)
|
||||
{
|
||||
return response()->json(Gadai::find($id));
|
||||
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||
$gadai_all = [];
|
||||
foreach($cawangan_all as $index=>$cawangan){
|
||||
$gadai = Gadai::on($cawangan['mysql'])->where('nokp','=',$noic)->get();
|
||||
if(sizeof($gadai) != 0){
|
||||
array_push($gadai_all,$gadai);
|
||||
}
|
||||
}
|
||||
|
||||
return response()->json($gadai_all);
|
||||
}
|
||||
|
||||
public function create(Request $request)
|
||||
|
||||
Reference in New Issue
Block a user