feat(StoreOrderController): 添加计算总价功能并更新导出订单文件路径

This commit is contained in:
mkm 2024-08-31 15:24:26 +08:00
parent c20da03e7c
commit 9dd5b83c34

View File

@ -164,12 +164,14 @@ class StoreOrderController extends BaseAdminController
$find=StoreProduct::where('id',$value->product_id)->find();
$value->store_name=$find['store_name']??'';
$value->store_info=$find['store_info']??'';
$value->total_price=bcmul($value['price'],$value['cart_num'],2);
if(!empty($find['unit'])){
$value->unit_name=StoreProductUnit::where('id',$find['unit'])->value('name');
}else{
$value->unit_name='';
}
}
$order['total_price']=$order['pay_price'];
$file_path = $xlsx->export($data,$system_store,$order);
return $this->success('导出成功', ['url' => $file_path]);