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 = [];
|
||||
}
|
||||
@@ -350,6 +350,10 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
||||
$router->get('getwakil/{kodcaw}/code/{nowakil}',['uses' => 'TebusController@getWakilbycode']);
|
||||
$router->put('ubahwakil/{kodcaw}',['uses'=>'TebusController@UbahWakil']);
|
||||
$router->post('createwakil/{kodcaw}/{icno}',['uses' => 'TebusController@createWakil']);
|
||||
$router->get('getwakil/{kodcaw}/status/{status}',['uses' => 'TebusController@getWakilbyStatus']);
|
||||
$router->get('lookupwakil',['uses' => 'TebusController@LookupWakil']);
|
||||
|
||||
|
||||
|
||||
//update tagterima Tebus
|
||||
$router->put('updatetagterima/{kodcaw}/{norujukan}',['uses'=>'TebusController@tagterimaupdate']);
|
||||
|
||||
Reference in New Issue
Block a user