root 4 年前
父节点
当前提交
c475e889fd

+ 3
- 2
app/Http/Controllers/Api/CompoundResourceController.php 查看文件

@@ -258,8 +258,8 @@ class CompoundResourceController extends BaseController
// }
// // $start_date = '';
// // $end_date = '';
// $start_date = '2020-08-29';
// $end_date = '2020-08-29';
// $start_date = '2020-09-29';
// $end_date = '2020-10-01';

// $enforcer = 'All';
// $faulty = 'All';
@@ -331,6 +331,7 @@ class CompoundResourceController extends BaseController
return $html;
})->addColumn('status_kemaskini', function($row) {
$data = '';

if($row['status'] == 'Berbayar'){

if ($row['modul'] == '02') {

+ 10
- 2
app/Http/Resources/CompoundResource.php 查看文件

@@ -14,14 +14,22 @@ class CompoundResource extends JsonResource
*/
public function toArray($request)
{
if($this->faulty != null && $this->staffdetail != null){

if($this->modul == '02' && (!empty($this->non)))
{
$kpd = $this->non;
}
else{
$kpd = $this->kpd;
}

return [
'_id' => $this->_id,
'modul' => $this->modul,
'jenis' => $this->jenis,
'kpd' => $this->kpd,
'kpd' => $kpd,
'no_plate' => $this->no_plate,
'nric' => $this->identity,
'no_daftar_syarikat' => $this->no_daftar_syarikat,

+ 7
- 7
public/js/dataPelbagai.js 查看文件

@@ -27,9 +27,9 @@ $(document).ready( function () {
{ "data": "enforcer", "name": "enforcer" },
{ "data": "status_kemaskini","name": "status", orderable: false, searchable: false },
{ "data": "_id", "name": "action", orderable: false, searchable: false },
],
],
"columnDefs": [
{
{
"render": function ( data, type, row, meta ) {
if (data != '') {
return '<label class="label label-success">'+data+'</label>&nbsp;'+(meta.row+1);
@@ -42,10 +42,10 @@ $(document).ready( function () {
{
"render": function ( data, type, row ) {
return '<div style="text-align:center"><a target="_blank" href="'+SITEURL+'/main/compound/'+row.kpd+'/index" class="btn btn-info btn-sm waves-effect waves-light">TERUSKAN</a>'
+'<button onclick="getDetail(\''+data+'\')" class="btn btn-primary btn-sm waves-effect waves-light">KEMASKINI STATUS</button></div>';
+'<button onclick="getDetail(\''+data+'\')" class="btn btn-primary btn-sm waves-effect waves-light">KEMASKINI STATUS</button></div>';
},
"targets": 12,
},
},
],
"drawCallback": function(settings) {
var api = this.api();
@@ -73,7 +73,7 @@ $(document).ready( function () {
}
});
}
},
},
"language": {
"paginate": {
"previous": "Sebelum",
@@ -86,5 +86,5 @@ $(document).ready( function () {
"info": "Tunjuk _START_ hingga _END_ daripada _TOTAL_ entri",
"sSearch": "Cari:",
}
});
});
});
});

正在加载...
取消
保存