Переглянути джерело

Merge remote-tracking branch 'origin/master'

gogs 1 рік тому
батько
коміт
221b763a01
1 змінених файлів з 11 додано та 1 видалено
  1. 11 1
      app/Service/ConstructionService.php

+ 11 - 1
app/Service/ConstructionService.php

@@ -135,6 +135,7 @@ class ConstructionService extends Service
                 $insert = [];
                 foreach ($data['file'] as $value){
                     $insert[] = [
+                        'order_number' => $data['order_number'],
                         'construction_id' => $data['id'],
                         'file' => $value['url'],
                         'name' => $value['name'],
@@ -254,6 +255,7 @@ class ConstructionService extends Service
                 $insert = [];
                 foreach ($data['file'] as $value){
                     $insert[] = [
+                        'order_number' => $data['order_number'],
                         'construction_id' => $data['id'],
                         'file' => $value['url'],
                         'name' => $value['name'],
@@ -298,7 +300,7 @@ class ConstructionService extends Service
                 ->update(['del_time' => time()]);
             ConstructionFile::where('del_time',0)
                 ->where('construction_id',$data['id'])
-                ->update(['del_time' => $time]);
+                ->update(['del_time' => time()]);
             ConstructionProductInfo::where('del_time',0)
                 ->where('construction_id',$data['id'])
                 ->update(['del_time' => time()]);
@@ -369,6 +371,14 @@ class ConstructionService extends Service
             ->select('b.title','a.contact_info')
             ->get()->toArray();
         $construction['customer_array'] = $info;
+        $info = CustomerInfo::from('customer_info as a')
+            ->leftJoin('basic_type as b','b.id','a.contact_type')
+            ->where('a.del_time',0)
+            ->where('a.customer_id',$construction['customer_id'])
+            ->where('a.contact_type','>',0)
+            ->select('b.title','a.contact_info')
+            ->get()->toArray();
+        $construction['customer_array'] = $info;
         $construction['storehouse_title'] = Storehouse::where('id',$construction['storehouse_id'])->value('title');
         $emp_title = Employee::where('id',$construction['customer_contact_id'])->value('emp_name');
         $construction['customer_contact_title'] = $emp_title;