fix apiaku

This commit is contained in:
hafifierahman
2021-11-14 10:51:46 +08:00
parent 59f746b566
commit d9ebb73880
3 changed files with 57 additions and 0 deletions
+25
View File
@@ -20,6 +20,7 @@ use App\Panjar;
use App\HargaEmas;
use App\Moratorium;
use App\Audit;
use App\LookupWakil;
use Illuminate\Http\Request;
@@ -753,6 +754,30 @@ class TebusController extends Controller
return response(0);
}
public function getWakilbyStatus($kodcaw,$status,Request $request){
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
if($status == 'hubungan')
{
$wakil = Wakil::on($cawangan['mysql'])
->where('hubungan','=',$request->hubungan)
->get();
}else{
$wakil = [];
}
return response()->json($wakil,200);
}
public function LookupWakil()
{
$lookupwakil = LookupWakil::on('mysql7')->get();
return response()->json($lookupwakil,200);
}
public function getWakil($kodcaw,$icno){
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class LookupWakil extends Model
{
protected $table = 'lookup_wakil';
public $timestamps = false;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'recno',
'hubungan'
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
// protected $hidden = [];
}