PMCORE-1651

This commit is contained in:
Paula Quispe
2020-06-16 11:24:32 -04:00
parent 984d0de944
commit d2cd0c2285
3 changed files with 66 additions and 3 deletions

View File

@@ -98,9 +98,22 @@ class AppNotes extends Model
$notes['notes'][] = $row;
});
// Add the total of rows to return
$notes['totalCount'] = $limit;
return $notes;
}
/**
* Return the total notes by case
*
* @param string $appUid
*
* @return array
*/
public static function getTotal(string $appUid)
{
$query = AppNotes::query()->select(['NOTE_ID']);
$query->appUid($appUid);
$total = $query->get()->count();
return $total;
}
}