update
parent
ed72dd2498
commit
c59d005be6
|
|
@ -7,8 +7,10 @@ use App\Models\Master\Menu;
|
||||||
use App\Models\Master\AccessMenu;
|
use App\Models\Master\AccessMenu;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\Master\Group;
|
use App\Models\Master\Group;
|
||||||
|
use App\Models\Master\Instansi;
|
||||||
use App\Models\Master\Dataset;
|
use App\Models\Master\Dataset;
|
||||||
use App\Models\Master\Topik;
|
use App\Models\Master\Topik;
|
||||||
|
use App\Models\Master\TabelData;
|
||||||
use App\Models\Log;
|
use App\Models\Log;
|
||||||
|
|
||||||
if (!function_exists('taskLabel')) {
|
if (!function_exists('taskLabel')) {
|
||||||
|
|
@ -385,6 +387,41 @@ if (!function_exists('topikById')) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!function_exists('tabelById')) {
|
||||||
|
function tabelById($id){
|
||||||
|
$keyId = decode_id($id);
|
||||||
|
$tabel = TabelData::find($keyId);
|
||||||
|
return $tabel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!function_exists('tabelInstansi')) {
|
||||||
|
function tabelInstansi($idInstansi){
|
||||||
|
|
||||||
|
// $table = Dataset::find($id);
|
||||||
|
$instansi = Instansi::find($idInstansi);
|
||||||
|
|
||||||
|
$decode = json_decode($instansi->resource_data);
|
||||||
|
$res = "Belum ada data";
|
||||||
|
if(@$decode){
|
||||||
|
$res = [];
|
||||||
|
$d = '';
|
||||||
|
foreach ($decode as $key => $value) {
|
||||||
|
if (($value !== null) && ($value !== "")) {
|
||||||
|
$d .= '<span class="p-1 bg-info rounded text-white">'.tabelById($value)->name.'</span> ';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// $d .= '</ul>';
|
||||||
|
array_push($res, $d);
|
||||||
|
|
||||||
|
$res = implode("", $res);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!function_exists('topikByDataset')) {
|
if (!function_exists('topikByDataset')) {
|
||||||
function topikByDataset($json){
|
function topikByDataset($json){
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ class HomeController extends Controller
|
||||||
$_data[] = [
|
$_data[] = [
|
||||||
'no' => $key+1,
|
'no' => $key+1,
|
||||||
'name' => @$row->name,
|
'name' => @$row->name,
|
||||||
'dataset' => '-',
|
'dataset' => tabelInstansi(@$row->MsInstansiId),
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue