cqp il y a 3 mois
Parent
commit
27817ea85f
1 fichiers modifiés avec 6 ajouts et 3 suppressions
  1. 6 3
      app/Service/PersonWorkService.php

+ 6 - 3
app/Service/PersonWorkService.php

@@ -397,8 +397,11 @@ class PersonWorkService extends Service
             ->get()->toArray();
             ->get()->toArray();
 
 
         $id = array_column($data,'employee_id');
         $id = array_column($data,'employee_id');
-        $map = Employee::whereIn('id', $id)->select('title','id','number')->get()->toArray();
-        $map = array_column($map,null,'id');
+        $map = Employee::whereIn('id', $id)
+            ->select('title','id','number')
+            ->get()
+            ->keyBy('id')
+            ->toArray();
 
 
         foreach ($data as $key => $value){
         foreach ($data as $key => $value){
             $tmp = $map[$value['employee_id']] ?? [];
             $tmp = $map[$value['employee_id']] ?? [];
@@ -457,7 +460,7 @@ class PersonWorkService extends Service
         $item = Item::where('id', $customer['item_id'])->first();
         $item = Item::where('id', $customer['item_id'])->first();
         $customer['item_title'] = $item->title;
         $customer['item_title'] = $item->title;
         $customer['item_code'] = $item->code;
         $customer['item_code'] = $item->code;
-        $customer['month'] = $customer['month'] ? date("Y-m",$customer['month']): '';
+        $customer['order_time'] = $customer['order_time'] ? date("Y-m-d",$customer['order_time']): '';
 
 
         $details = $this->getDetailDaily($data['id']);
         $details = $this->getDetailDaily($data['id']);
         $customer = array_merge($customer, $details);
         $customer = array_merge($customer, $details);