mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 22:50:44 +00:00
bug修复
This commit is contained in:
parent
ca20c9020e
commit
b8cc587c63
@ -34,11 +34,8 @@ class GoodsCombinationController extends Controller
|
|||||||
$orderRestTime = DeveloperConfig::query()
|
$orderRestTime = DeveloperConfig::query()
|
||||||
->where('key', DeveloperConfig::$ORDER_RESET_TIME)
|
->where('key', DeveloperConfig::$ORDER_RESET_TIME)
|
||||||
->value('value');
|
->value('value');
|
||||||
$time = date('Y-m-d 07:00:00');
|
|
||||||
if (is_null($orderRestTime)) {
|
if (is_null($orderRestTime)) {
|
||||||
$orderRestTime = $time;
|
$orderRestTime = date('Y-m-d 07:00:00');
|
||||||
} else {
|
|
||||||
$orderRestTime = Carbon::parse($orderRestTime)->lt(Carbon::parse($time)) ? $time : $orderRestTime;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$businessOrderItems = BusinessOrderItem::query()
|
$businessOrderItems = BusinessOrderItem::query()
|
||||||
|
|||||||
@ -59,11 +59,8 @@ class GoodsSkusController extends Controller
|
|||||||
$orderRestTime = DeveloperConfig::query()
|
$orderRestTime = DeveloperConfig::query()
|
||||||
->where('key', DeveloperConfig::$ORDER_RESET_TIME)
|
->where('key', DeveloperConfig::$ORDER_RESET_TIME)
|
||||||
->value('value');
|
->value('value');
|
||||||
$time = date('Y-m-d 07:00:00');
|
|
||||||
if (is_null($orderRestTime)) {
|
if (is_null($orderRestTime)) {
|
||||||
$orderRestTime = $time;
|
$orderRestTime = date('Y-m-d 07:00:00');
|
||||||
} else {
|
|
||||||
$orderRestTime = Carbon::parse($orderRestTime)->lt(Carbon::parse($time)) ? $time : $orderRestTime;
|
|
||||||
}
|
}
|
||||||
$businessOrderItems = BusinessOrderItem::query()
|
$businessOrderItems = BusinessOrderItem::query()
|
||||||
->select(DB::raw($fields))
|
->select(DB::raw($fields))
|
||||||
@ -304,9 +301,6 @@ class GoodsSkusController extends Controller
|
|||||||
$log = new LogModel();
|
$log = new LogModel();
|
||||||
$log->batchInsert($logs);
|
$log->batchInsert($logs);
|
||||||
DB::commit();
|
DB::commit();
|
||||||
if (!empty($updateIds)) {
|
|
||||||
event(new BatchStockUpdateEvent($updateIds));
|
|
||||||
}
|
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
DB::rollBack();
|
DB::rollBack();
|
||||||
$this->res = [
|
$this->res = [
|
||||||
@ -315,7 +309,9 @@ class GoodsSkusController extends Controller
|
|||||||
'errorMessage' => $exception->getMessage(),
|
'errorMessage' => $exception->getMessage(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
if (!empty($updateIds)) {
|
||||||
|
event(new BatchStockUpdateEvent($updateIds));
|
||||||
|
}
|
||||||
return response($this->res, $this->res['httpCode']);
|
return response($this->res, $this->res['httpCode']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -71,13 +71,14 @@ class SaleStockImport implements ToArray, SkipsEmptyRows
|
|||||||
$log = new LogModel();
|
$log = new LogModel();
|
||||||
$log->batchInsert($logs);
|
$log->batchInsert($logs);
|
||||||
DB::commit();
|
DB::commit();
|
||||||
if (!empty($updateIds)) {
|
|
||||||
event(new BatchStockUpdateEvent($updateIds));
|
|
||||||
}
|
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
DB::rollBack();
|
DB::rollBack();
|
||||||
throw new Exception($exception->getMessage());
|
throw new Exception($exception->getMessage());
|
||||||
}
|
}
|
||||||
|
if (!empty($updateIds)) {
|
||||||
|
event(new BatchStockUpdateEvent($updateIds));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,7 +49,7 @@ class BatchStockUpdateListener implements ShouldQueue
|
|||||||
->where('external_sku_id', $goodsSku->external_sku_id)
|
->where('external_sku_id', $goodsSku->external_sku_id)
|
||||||
->get();
|
->get();
|
||||||
BusinessFactory::init()->make($shop['plat_id'])->setShopWithId($shop['id'])->batchIncrQuantity($businessGoodsSkus->toArray(), $num, false);
|
BusinessFactory::init()->make($shop['plat_id'])->setShopWithId($shop['id'])->batchIncrQuantity($businessGoodsSkus->toArray(), $num, false);
|
||||||
usleep(140);
|
usleep(50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user