Compare commits

...

1 Commits

Author SHA1 Message Date
edmondlang 1578085bab add attached timestamp 2023-12-30 16:55:45 +08:00
9 changed files with 10 additions and 10 deletions
@@ -20,7 +20,7 @@ class AssignsAnnouncementToSegment extends AbstractUpdateRecord
{
try {
$announcement->segments()->attach($segment);
$announcement->segments()->attach($segment, ['created_at' => now(), 'updated_at' => now()]);
return $announcement;
@@ -20,7 +20,7 @@ class AssignsCompanyConnectionToConnectionSegment extends AbstractUpdateRecord
{
try {
$companyConnection->segments()->attach($segment);
$companyConnection->segments()->attach($segment, ['created_at' => now(), 'updated_at' => now()]);
return $companyConnection;
@@ -22,7 +22,7 @@ class AssignsCompanyToSegment extends AbstractUpdateRecord
try {
$companyModule = $company->companyModules()->where('type', BusinessType::IMPORTER)->first();
$connection = $companyModule->connections()->where('inviter_reference', 'CIEF');
$connection->segments()->attach($segment);
$connection->segments()->attach($segment, ['created_at' => now(), 'updated_at' => now()]);
return $company;
@@ -18,7 +18,7 @@ class AssignsEmployee extends AbstractUpdateRecord
{
try {
$object->getCompanyModule()->employees()->attach($object->getUser(), ['status' => $object->getStatus(),'role_id' => $object->getRoleId()]);
$object->getCompanyModule()->employees()->attach($object->getUser(), ['status' => $object->getStatus(), 'role_id' => $object->getRoleId(), 'created_at' => now(), 'updated_at' => now()]);
return $object->getCompanyModule();
@@ -53,7 +53,7 @@ class AssignPackingListContainerLogic extends AbstractControllerLogic
foreach ($packing_list as $key => $row) {
$packing_list_item = $this->fetchesPackingList->execute(['id' => $row]);
$container->packingLists()->attach($packing_list_item);
$container->packingLists()->attach($packing_list_item, ['created_at' => now(), 'updated_at' => now()]);
}
return $this->resourceResponse(new ContainerResource($container));
@@ -129,7 +129,7 @@ class FetchContainersFromYdPortalProcessor
try {
$container = $this->fetchesContainer->execute(['reference' => $containerReference]);
$container->packingLists()->detach($packingList);
$container->packingLists()->attach($packingList);
$container->packingLists()->attach($packingList, ['created_at' => now(), 'updated_at' => now()]);
} catch (ResourceNotFoundException $exception){
if(!($packingList->owner instanceof Order)) continue;
@@ -143,7 +143,7 @@ class FetchContainersFromYdPortalProcessor
$container = $this->createContainerProcessor->execute($containerObject, $originWarehouse);
$container->packingLists()->detach($packingList);
$container->packingLists()->attach($packingList);
$container->packingLists()->attach($packingList, ['created_at' => now(), 'updated_at' => now()]);
if(config('perfexcrm.is_enabled') == 'true'){
$this->packingListToPerfexCRMProcessor->execute($packingList, PerfexCRMTasksYDStages::LOAD_CONTAINER);
@@ -274,7 +274,7 @@ class FetchLoadedContainersFromVTPortalProcessor
}
$container->packingLists()->detach($packingList);
$container->packingLists()->attach($packingList);
$container->packingLists()->attach($packingList, ['created_at' => now(), 'updated_at' => now()]);
$packingList->packages()->delete();
$replica = $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first();
@@ -385,7 +385,7 @@ class FetchOrderListsFromYdPortalProcessor
try {
$container = $this->fetchesContainer->execute(['reference' => $containerReference]);
$container->packingLists()->detach($packingList);
$container->packingLists()->attach($packingList);
$container->packingLists()->attach($packingList, ['created_at' => now(), 'updated_at' => now()]);
} catch (ResourceNotFoundException $exception){
if (!$allow_contract) {
+1 -1
View File
@@ -531,7 +531,7 @@ class DummyDataSeeder extends Seeder
$container = $this->faker->randomElement(Container::whereDate('loading_date', '>=', $receiveDate)->get());
// attach packing list to container
$container->packingLists()->attach($shippingPackingList);
$container->packingLists()->attach($shippingPackingList, ['created_at' => now(), 'updated_at' => now()]);
if ($container->status !== ApprovalStatus::COMPLETED) {
// ==== //