Compare commits
2 Commits
20250806-1
...
20250806-1
| Author | SHA1 | Date | |
|---|---|---|---|
| 26f58eee32 | |||
| 00aa36c574 |
@@ -87,10 +87,16 @@ class ChefService extends BaseService
|
||||
|
||||
$skuIds = array_column($list['data'], 'sku_id');
|
||||
$chefIds = array_column($list['data'], 'chef_id');
|
||||
$skuList = $this->skuModel->whereIn('id', $skuIds)->pluck('title', 'id')->toArray();
|
||||
$chefList = $this->adminUserModel->whereIn('id',$chefIds)->pluck('chinese_name','id')->toArray();
|
||||
$skuList = $this->skuModel->whereIn('id', $skuIds)->select('price','title','id')->get();
|
||||
if ($skuList->isNotEmpty()) {
|
||||
$skuList = array_column($skuList->toArray(), null,'id');
|
||||
}
|
||||
|
||||
$chefList = $this->adminUserModel->getChefNameByIds($chefIds);
|
||||
foreach ($list['data'] as &$v) {
|
||||
$v['sku_title'] = $skuList[$v['sku_id']] ?? '';
|
||||
$v['sku_title'] = $skuList[$v['sku_id']]['title'] ?? '';
|
||||
$v['sku_price'] = $skuList[$v['sku_id']]['price'] ?? '0.00';
|
||||
$v['total_price'] = bcmul($skuList[$v['sku_id']]['price'],$v['sale'],2);
|
||||
$v['chef_name'] = $chefList[$v['chef_id']] ?? '';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user