main
panliang 2024-04-28 10:42:12 +08:00
parent cb8a32101b
commit 5772c4f002
3 changed files with 3 additions and 6 deletions

View File

@ -211,9 +211,7 @@ class WorkFlowService extends BaseService
}
$checkValue = [$user->id];
if ($user->jobs && $user->jobs->count() > 0) {
$max = $user->jobs->max('sort');
$jobs = Keyword::where('parent_key', 'job')->where('sort', '<', $max)->get();
foreach($user->jobs->merge($jobs) as $item) {
foreach($user->jobs as $item) {
array_push($checkValue, $user->store_id . '-' . $item->key);
}
}

View File

@ -31,6 +31,7 @@ class EmployeePromotionResource extends JsonResource
'promotion_status_text' => $this->promotion_status->text(),
'employee_data' => $this->employee_data,
'created_at' => $this->created_at->timestamp,
'created_format' => $this->created_at->format('Y-m-d H:i:s'),
'workflow_check' => WorkflowCheckResource::make($this->whenLoaded('workflow')),
];

View File

@ -40,9 +40,7 @@ class WorkflowLog extends Model
$checkValue = [$user->id];
$userJobs = $user->jobs;
if ($userJobs && $userJobs->count() > 0) {
$max = $userJobs->max('sort');
$jobs = Keyword::where('parent_key', 'job')->where('sort', '<=', $max)->get();
foreach($userJobs->merge($jobs)->unique('key') as $item) {
foreach($userJobs->unique('key') as $item) {
array_push($checkValue, $user->store_id . '-' . $item->key);
}
}