fix apiaku
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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 = [];
|
||||
}
|
||||
Reference in New Issue
Block a user