Improvement quality of task faker data

This commit is contained in:
David Bomba 2023-11-16 20:10:16 +11:00
parent 48f39c1533
commit b505bbc6c0
2 changed files with 7 additions and 8 deletions

View File

@ -254,18 +254,19 @@ class Task extends BaseModel
public function processLogs()
{
nlog($this->toArray());
return
collect($this->time_log)->map(function ($log){
collect(json_decode($this->time_log,true))->map(function ($log){
nlog($log);
$parent_entity = $this->client ?? $this->company;
if($log[0])
$log[0] = Carbon::createFromTimestamp($log[0])->format($parent_entity->date_format());
$log[0] = Carbon::createFromTimestamp($log[0])->format($parent_entity->date_format().' H:m:s');
if($log[1] && $log[1] != 0)
$log[1] = Carbon::createFromTimestamp($log[1])->format($parent_entity->date_format());
$log[1] = Carbon::createFromTimestamp($log[1])->format($parent_entity->date_format().' H:m:s');
else
$log[1] = ctrans('texts.running');

File diff suppressed because one or more lines are too long