Corección de error al escribir
This commit is contained in:
parent
01cd737b29
commit
f070777945
@ -449,9 +449,9 @@ private function processPackageFromText(SimCard $sim, array $row)
|
||||
);
|
||||
|
||||
$hasActivePackage = $sim->packages()
|
||||
->wherePivot('package_id', $package->id)
|
||||
->wherePivot('is_active', true)
|
||||
->exists();
|
||||
->wherePivot('package_id', $package->id)
|
||||
->wherePivot('is_active', true)
|
||||
->exists();
|
||||
|
||||
if (!$hasActivePackage) {
|
||||
$sim->packages()->attach($package->id, [
|
||||
@ -490,12 +490,16 @@ private function getOrCreatePackage(string $type, float $price): Packages
|
||||
return $this->packageCache[$cacheKey];
|
||||
}
|
||||
|
||||
$package = Packages::create([
|
||||
'name' => $type,
|
||||
'price' => (float) $price,
|
||||
'period' => 0,
|
||||
'data_limit' => 0,
|
||||
]);
|
||||
$package = Packages::firstOrCreate(
|
||||
[
|
||||
'name' => $type,
|
||||
'price' => (float) $price
|
||||
],
|
||||
[
|
||||
'period' => 0,
|
||||
'data_limit' => 0,
|
||||
]
|
||||
);
|
||||
|
||||
if ($package->wasRecentlyCreated) {
|
||||
$this->stats['packages_created']++;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user