admin agreement

main
panliang 2024-04-28 09:53:11 +08:00
parent 57fd08dc41
commit cb8a32101b
3 changed files with 8 additions and 2 deletions

View File

@ -136,8 +136,9 @@ class AgreementController extends AdminController
$filename = time().'.zip'; $filename = time().'.zip';
$filepath = storage_path('app/' . $filename); $filepath = storage_path('app/' . $filename);
$zip->open($filepath, \ZipArchive::CREATE | \ZipArchive::OVERWRITE); $zip->open($filepath, \ZipArchive::CREATE | \ZipArchive::OVERWRITE);
$baseUrl = Storage::disk('public')->url('');
foreach($model->images as $item) { foreach($model->images as $item) {
$path = data_get($item, 'value'); $path = str_replace($baseUrl, '', $item);
$info = pathinfo($path); $info = pathinfo($path);
$zip->addFile(Storage::disk('public')->path($path), data_get($info, 'basename')); $zip->addFile(Storage::disk('public')->path($path), data_get($info, 'basename'));
} }

View File

@ -97,7 +97,7 @@ class EmployeeSignRepairService extends BaseService
'employee_id' => $data['employee_id'], 'employee_id' => $data['employee_id'],
'sign_time' => $data['sign_time'] 'sign_time' => $data['sign_time']
])->exists()) { ])->exists()) {
return '已经过卡了'; return '已经过卡了';
} }
// todo 已经打卡不能申请 // todo 已经打卡不能申请
// todo 验证申请时间是否重复 // todo 验证申请时间是否重复

View File

@ -15,6 +15,11 @@ class EmployeeSignService extends BaseService
protected string $modelFilterName = EmployeeSignFilter::class; protected string $modelFilterName = EmployeeSignFilter::class;
public function sortColumn()
{
return 'date';
}
public function preDelete(array $ids): void public function preDelete(array $ids): void
{ {
// 删除打卡日志 // 删除打卡日志