print sag

This commit is contained in:
LAPTOP-DGCU80CH\user1
2020-12-13 14:20:59 +08:00
parent aae73d8f36
commit 3dcbdb5a2b
4 changed files with 48 additions and 2 deletions
+26
View File
@@ -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);
}
}
+3 -2
View File
@@ -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);
+1
View File
@@ -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']);