修复内容

This commit is contained in:
2026-01-30 18:48:13 +08:00
parent 5fe5289e26
commit 76cfa6b278
25 changed files with 943 additions and 289 deletions

View File

@@ -624,6 +624,47 @@ class StaffLogic{
public static function adder($post){
return Db::name('staff')->where('id',$post['id'])->update(['lng'=>$post['store_longitude'],'lat'=>$post['store_latitude']]);
}
// 员工工资导出数据(基于 wages 列表结果,避免重复重算导致超时)
public static function wagesExport($get)
{
// 导出时最多导出 5000 条,且沿用 wages 的统计逻辑
$get['page'] = 1;
$get['limit'] = isset($get['limit']) && (int)$get['limit'] > 0 ? (int)$get['limit'] : 5000;
$data = self::wages($get);
$lists = $data['lists'] ?? [];
// 组装导出数据
$exportTitle = ['员工姓名', '员工电话', '服务总订单', '上午订单', '下午订单', '财务报销', '上午加时', '下午加时', '请假天数', '出勤天数', '罚款金额', '异常订单', '年卡订单', '物料金额'];
$exportData = [];
foreach ($lists as $row) {
$exportData[] = [
$row['name'] ?? '',
$row['mobile'] ?? '',
$row['total_orders'] ?? 0,
$row['sw_orders'] ?? 0,
$row['xw_orders'] ?? 0,
$row['finance'] ?? 0,
$row['sw_addtimes'] ?? 0,
$row['xw_addtimes'] ?? 0,
$row['leaves'] ?? 0,
$row['attendance'] ?? 0,
$row['fine'] ?? 0,
$row['abnormal'] ?? 0,
$row['annual'] ?? 0,
$row['erp_staff'] ?? 0,
];
}
$exportExt = 'xls';
return [
'exportTitle' => $exportTitle,
'exportData' => $exportData,
'exportExt' => $exportExt,
'exportName' => '员工工资-' . date('Y-m-d H:i:s'),
];
}
//获取员工积分记录
public static function points($get){