购买详情增加剩余统收额度字段

wenjuan
yanzai 1 year ago
parent fb8f815be2
commit 7ccad991c1

@ -293,6 +293,7 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
$group_info = false; $group_info = false;
$lose_price=0;
if (!!$group_id) { if (!!$group_id) {
$P = new PersonController(); $P = new PersonController();
$data = [ $data = [
@ -302,7 +303,15 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
]; ];
$group_info = $P->group_info($hospital_id, $data); $group_info = $P->group_info($hospital_id, $data);
if(count($group_info)==0) return \Yz::echoError1("获取团检登记信息失败");
//如果是团检统收限额大于0并且没有自带项目则判断剩余金额
if($group_info[0]['tongshou_xiane']>0 and count($group_info[0]['items'])==0){
$lose_price=$group_info[0]['tongshou_xiane']- $true_price;
if($lose_price<0) $lose_price=0;
}
$true_price = $true_price + $group_info[0]['sixi_zong_ji_jin_e'];
$true_price = ($true_price - $group_info[0]['tongshou_xiane']) > 0 ? $true_price - $group_info[0]['tongshou_xiane'] : 0;
$all_items = DB::table('items')->where(['status' => 1])->get(); $all_items = DB::table('items')->where(['status' => 1])->get();
$item_new = []; $item_new = [];
@ -347,6 +356,7 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
'true_price' => $true_price,//需要用户支付的金的 'true_price' => $true_price,//需要用户支付的金的
'original_price' => $all_original_price,//总原价 'original_price' => $all_original_price,//总原价
'pay_item_count' => $pay_item_count,//需要付费的项目数量 'pay_item_count' => $pay_item_count,//需要付费的项目数量
'lose_price'=>$lose_price,//剩余的不用就会浪费的金额
'nmr_list' => [[ 'nmr_list' => [[
'item_id' => "1", 'item_id' => "1",
"name" => "磁共振平扫(腰椎)" "name" => "磁共振平扫(腰椎)"
@ -369,6 +379,7 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
} }
return \Yz::Return(true, "查询完成", ['list' => $combos]); return \Yz::Return(true, "查询完成", ['list' => $combos]);
} }
//推荐套餐 //推荐套餐
public function ComboRecommend() public function ComboRecommend()
{ {

Loading…
Cancel
Save