创建订单判断团检,根据统收限额计算金额

wenjuan
yanzai 1 year ago
parent 4f42ec9291
commit 35c13b4c3f

@ -117,6 +117,7 @@ class OrderController extends Controller
if (!$person) return \Yz::echoError1('体检人不存在');
$title = "自选项目";
$price = 0;
$true_price=0;//订单真实支付金额
$buy_info = [
'combo' => [
'id' => 0,
@ -161,6 +162,7 @@ class OrderController extends Controller
$missingIds = array_diff($item_ids, $existingIds);
if (count($missingIds) > 0) return \Yz::echoError1("部分自选项目不可用Id:" . implode(', ', $missingIds));
}
$true_price=$price;
//如果是团检
$group_info = false;
if ($type == 2) {
@ -181,6 +183,8 @@ class OrderController extends Controller
'group_id' => $group_info['group_id'],
];
$title = "单位团检" . $group_info['combo_name'];
$price = $price + $group_info['sixi_zong_ji_jin_e'];
$true_price = ($price - $group_info['tongshou_xiane']) > 0 ? $price - $group_info['tongshou_xiane'] : 0;
}
//调用思信接口判断各个项目是否可用
@ -258,7 +262,7 @@ class OrderController extends Controller
'id_number' => $person->id_number,
'buy_info' => json_encode($buy_info, JSON_UNESCAPED_UNICODE),
'price' => $price,
'true_price' => $price,
'true_price' => $true_price,
'order_number' => $order_num,
'status' => 1,
'appointment_date' => $plan->date,

@ -34,6 +34,7 @@ class PersonController extends Controller
'group_name' => $group_info['单位名称'] . ($group_info['部门名称']),
'group_id' => $group_info['预约Id'],
'tongshou_xiane'=>$group_info['统收限额'],
'sixi_zong_ji_jin_e'=>$group_info['总计金额'],
'items' => $items,
];
$group_list[]=$data;

Loading…
Cancel
Save