print sag
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CawanganDetail extends Model
|
||||
{
|
||||
protected $table = 'cawangan';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
// protected $fillable = [
|
||||
|
||||
// ];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
// protected $hidden = [];
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\CawanganDetail;
|
||||
use App\Cawangan;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CawanganDetailController extends Controller
|
||||
{
|
||||
public function getCawanganDetail($kodcaw){
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$cawangan_detail = CawanganDetail::on($cawangan['mysql'])->get();
|
||||
|
||||
return response()->json($cawangan_detail);
|
||||
}
|
||||
}
|
||||
@@ -249,12 +249,13 @@ class GadaiController extends Controller
|
||||
return response()->json($gadai,200);
|
||||
}
|
||||
|
||||
public function cetakSAG($kodcaw,$norujukan){
|
||||
public function cetakSAG($kodcaw,$norujukan,Request $request){
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
$gadai = Gadai::on($cawangan['mysql'])
|
||||
->where('norujukan','=',$norujukan)
|
||||
->update(array(
|
||||
'cetak' => 1
|
||||
'cetak' => 1,
|
||||
'penilai' => $request->penilai
|
||||
));
|
||||
|
||||
return response()->json($gadai,200);
|
||||
|
||||
@@ -92,6 +92,7 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
||||
//Cawangan API
|
||||
$router->get('cawangan',['uses'=>'CawanganController@showAllCawangans']);
|
||||
$router->get('cawangan/{code_cawangan}',['uses'=>'CawanganController@showOneCawangan']);
|
||||
$router->get('cawangan/detail/{kodcaw}',['uses'=>'CawanganDetailController@getCawanganDetail']);
|
||||
|
||||
//Poskod API
|
||||
$router->get('poskod',['uses'=>'PoskodController@showAllPoskod']);
|
||||
|
||||
Reference in New Issue
Block a user