feat : order list
This commit is contained in:
@@ -97,9 +97,9 @@ class ChefService
|
||||
$orderGoods = $orderGoods->toArray();
|
||||
|
||||
$skuIds = array_unique(array_column($orderGoods, 'sku_id'));
|
||||
$skuInfo = $this->skuModel->whereIn('id',$skuIds)->pluck('spu_id','id')->toArray();
|
||||
if (empty($skuInfo)) throw new Exception('skuInfoError:dataNull');
|
||||
$spuInfo = $this->spuModel->whereIn('id',array_unique(array_values($skuInfo)))->pluck('chef_id','id')->toArray();
|
||||
$chefList = $this->skuModel->whereIn('id',$skuIds)->pluck('chef_id','id')->toArray();
|
||||
if (empty($chefList)) throw new Exception('chefInfoError:dataNull');
|
||||
|
||||
|
||||
$currentDate = date('Y-m-d H:i:s');
|
||||
|
||||
@@ -108,7 +108,7 @@ class ChefService
|
||||
if (empty($insertData[$orderGood['sku_id']])) {
|
||||
$insertData[$orderGood['sku_id']] = [
|
||||
'date' => $cycle->dates,
|
||||
'chef_id' => $spuInfo[$skuInfo[$orderGood['sku_id']]]['chef_id'] ?? 0,
|
||||
'chef_id' => $chefList[$orderGood['sku_id']] ?? 0,
|
||||
'sku_id' => $orderGood['sku_id'],
|
||||
'cycle_id' => $this->cycleId,
|
||||
'kitchen_id' => $this->kitchenId,
|
||||
|
||||
Reference in New Issue
Block a user