|
@@ -863,6 +863,12 @@ class ProductService extends Service
|
|
|
public function getProductDetail($product_id = []){
|
|
|
if(empty($product_id)) return [];
|
|
|
$pro = Product::whereIn('id', $product_id)->get()->toArray();
|
|
|
+ $category = ProductCategory::whereIn('id',array_unique(array_column($pro,'product_category_id')))
|
|
|
+ ->pluck('is_edit_unit_price','id')
|
|
|
+ ->toArray();
|
|
|
+ foreach ($pro as $key => $value){
|
|
|
+ $pro[$key]['is_edit_unit_price'] = $category[$value['product_category_id']] ?? 0;
|
|
|
+ }
|
|
|
return array_column($pro,null,'id');
|
|
|
}
|
|
|
|