|
@@ -4,12 +4,14 @@ namespace App\Service;
|
|
|
|
|
|
use App\Model\BasicType;
|
|
use App\Model\BasicType;
|
|
use App\Model\Construction;
|
|
use App\Model\Construction;
|
|
|
|
+use App\Model\ConstructionFile;
|
|
use App\Model\ConstructionInfo;
|
|
use App\Model\ConstructionInfo;
|
|
use App\Model\ConstructionProductInfo;
|
|
use App\Model\ConstructionProductInfo;
|
|
use App\Model\Customer;
|
|
use App\Model\Customer;
|
|
use App\Model\Depart;
|
|
use App\Model\Depart;
|
|
use App\Model\Employee;
|
|
use App\Model\Employee;
|
|
use App\Model\SalesOrder;
|
|
use App\Model\SalesOrder;
|
|
|
|
+use App\Model\SalesOrderInfo;
|
|
use App\Model\SalesOrderProductInfo;
|
|
use App\Model\SalesOrderProductInfo;
|
|
use App\Model\ScheduleInfo;
|
|
use App\Model\ScheduleInfo;
|
|
use App\Model\SeeRange;
|
|
use App\Model\SeeRange;
|
|
@@ -71,6 +73,9 @@ class ConstructionService extends Service
|
|
ConstructionProductInfo::where('del_time',0)
|
|
ConstructionProductInfo::where('del_time',0)
|
|
->where('construction_id',$data['id'])
|
|
->where('construction_id',$data['id'])
|
|
->update(['del_time' => $time]);
|
|
->update(['del_time' => $time]);
|
|
|
|
+ ConstructionFile::where('del_time',0)
|
|
|
|
+ ->where('construction_id',$data['id'])
|
|
|
|
+ ->update(['del_time' => $time]);
|
|
|
|
|
|
if(! empty($data['construction_contact'])){
|
|
if(! empty($data['construction_contact'])){
|
|
$insert = [];
|
|
$insert = [];
|
|
@@ -124,6 +129,20 @@ class ConstructionService extends Service
|
|
|
|
|
|
if(! empty($data['schedule_info_id'])) ScheduleInfo::where('id',$data['schedule_info_id'])->update(['is_use' => 1]);
|
|
if(! empty($data['schedule_info_id'])) ScheduleInfo::where('id',$data['schedule_info_id'])->update(['is_use' => 1]);
|
|
|
|
|
|
|
|
+ if(! empty($data['file'])){
|
|
|
|
+ $insert = [];
|
|
|
|
+ foreach ($data['file'] as $value){
|
|
|
|
+ $insert[] = [
|
|
|
|
+ 'construction_id' => $data['id'],
|
|
|
|
+ 'file' => $value['url'],
|
|
|
|
+ 'name' => $value['name'],
|
|
|
|
+ 'mark' => $value['mark'] ?? "",
|
|
|
|
+ 'crt_time' => $time,
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+ ConstructionFile::insert($insert);
|
|
|
|
+ }
|
|
|
|
+
|
|
DB::commit();
|
|
DB::commit();
|
|
}catch (\Exception $exception){
|
|
}catch (\Exception $exception){
|
|
DB::rollBack();
|
|
DB::rollBack();
|
|
@@ -229,6 +248,20 @@ class ConstructionService extends Service
|
|
|
|
|
|
if(! empty($data['schedule_info_id'])) ScheduleInfo::where('id',$data['schedule_info_id'])->update(['is_use' => 1]);
|
|
if(! empty($data['schedule_info_id'])) ScheduleInfo::where('id',$data['schedule_info_id'])->update(['is_use' => 1]);
|
|
|
|
|
|
|
|
+ if(! empty($data['file'])){
|
|
|
|
+ $insert = [];
|
|
|
|
+ foreach ($data['file'] as $value){
|
|
|
|
+ $insert[] = [
|
|
|
|
+ 'construction_id' => $data['id'],
|
|
|
|
+ 'file' => $value['url'],
|
|
|
|
+ 'name' => $value['name'],
|
|
|
|
+ 'mark' => $value['mark'] ?? "",
|
|
|
|
+ 'crt_time' => $time,
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+ ConstructionFile::insert($insert);
|
|
|
|
+ }
|
|
|
|
+
|
|
DB::commit();
|
|
DB::commit();
|
|
}catch (\Exception $exception){
|
|
}catch (\Exception $exception){
|
|
DB::rollBack();
|
|
DB::rollBack();
|
|
@@ -261,6 +294,9 @@ class ConstructionService extends Service
|
|
ConstructionInfo::where('del_time',0)
|
|
ConstructionInfo::where('del_time',0)
|
|
->where('construction_id',$data['id'])
|
|
->where('construction_id',$data['id'])
|
|
->update(['del_time' => time()]);
|
|
->update(['del_time' => time()]);
|
|
|
|
+ ConstructionFile::where('del_time',0)
|
|
|
|
+ ->where('construction_id',$data['id'])
|
|
|
|
+ ->update(['del_time' => $time]);
|
|
ConstructionProductInfo::where('del_time',0)
|
|
ConstructionProductInfo::where('del_time',0)
|
|
->where('construction_id',$data['id'])
|
|
->where('construction_id',$data['id'])
|
|
->update(['del_time' => time()]);
|
|
->update(['del_time' => time()]);
|
|
@@ -343,6 +379,19 @@ class ConstructionService extends Service
|
|
}
|
|
}
|
|
$construction = $construction[0];
|
|
$construction = $construction[0];
|
|
|
|
|
|
|
|
+ $construction['file'] = [];
|
|
|
|
+ $file = ConstructionFile::where('del_time',0)
|
|
|
|
+ ->where('construction_id',$construction['id'])
|
|
|
|
+ ->select('id','construction_id','file','name','mark')
|
|
|
|
+ ->get()->toArray();
|
|
|
|
+ foreach ($file as $value){
|
|
|
|
+ $construction['file'][] = [
|
|
|
|
+ 'url' => $value['file'],
|
|
|
|
+ 'name' => $value['name'],
|
|
|
|
+ 'mark' => $value['mark'],
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+
|
|
$construction_info = ConstructionInfo::where('del_time',0)
|
|
$construction_info = ConstructionInfo::where('del_time',0)
|
|
->where('construction_id',$construction['id'])
|
|
->where('construction_id',$construction['id'])
|
|
->select('id','construction_id','employee_id','type','contact_type','contact_info')
|
|
->select('id','construction_id','employee_id','type','contact_type','contact_info')
|