鹿和sa0ChunLuyu 1 year ago
commit 0a7afdc786

@ -14,6 +14,7 @@ use Illuminate\Support\Facades\Schema;
class AspNetZhuanController extends Controller class AspNetZhuanController extends Controller
{ {
public static $request; public static $request;
public static $BaseUrl = "http://220.174.210.111:82";//url
public static $JF_BaseUrl = "http://220.174.210.111:82/jifen.aspx";//积分预存款Url public static $JF_BaseUrl = "http://220.174.210.111:82/jifen.aspx";//积分预存款Url
//获取用户积分和预存款 //获取用户积分和预存款
@ -40,6 +41,12 @@ class AspNetZhuanController extends Controller
$res = self::Get(self::$JF_BaseUrl . '?type=5' . '&ghzid=' . $ghzid. '&yucunkuan=' . $yucunkuan.'&yyid='.$yyid.'&yucunkuanleixing='.$yucunkuanleixing.'&caozuorenid='.$caozuorenid.'&caozuorenmigncheng='.urlencode($caozuorenmigncheng).'&beizhu='.urlencode($beizhu).'&dingdanshijian='.urlencode($dingdanshijian),"预存款变更"); $res = self::Get(self::$JF_BaseUrl . '?type=5' . '&ghzid=' . $ghzid. '&yucunkuan=' . $yucunkuan.'&yyid='.$yyid.'&yucunkuanleixing='.$yucunkuanleixing.'&caozuorenid='.$caozuorenid.'&caozuorenmigncheng='.urlencode($caozuorenmigncheng).'&beizhu='.urlencode($beizhu).'&dingdanshijian='.urlencode($dingdanshijian),"预存款变更");
return true; return true;
} }
//二线预约
public static function GetNmrList($data,$nonce)
{
$res= self::Post(self::$BaseUrl . '/erxian.aspx?str='.$nonce,$data,'二线号源');
return $res['data'];
}
@ -69,6 +76,36 @@ class AspNetZhuanController extends Controller
throw new HttpResponseException(\Yz::echoError1("查询用户积分预存款失败,status:" . $status . "body:" . $body)); throw new HttpResponseException(\Yz::echoError1("查询用户积分预存款失败,status:" . $status . "body:" . $body));
} }
} }
public static function Post($url,$data,$mark)
{
self::RequestLog($url, $data, $mark, '.Net转发');
$response = Http::post($url,$data);
if ($response->successful()) {
$res = $response->json();
$res_string=json_encode($res, JSON_UNESCAPED_UNICODE);
$str_len = mb_strlen($res_string, 'utf-8');
$str_size = $str_len / 1024;
$save_res = $res_string;
if ($str_size > 10) $save_res = '{"data":"Row size too large"}';
self::$request->response_data = $save_res;
self::$request->save();
if ($res['code'] == "200") {
return $res;
} else {
throw new HttpResponseException(\Yz::echoError1("查询用户积分预存款失败:" . $res['msg']));
}
} else {
$status = $response->status();
// 获取响应体作为字符串
$body = $response->body();
self::$request->response_data = $body;
self::$request->save();
throw new HttpResponseException(\Yz::echoError1("查询用户积分预存款失败,status:" . $status . "body:" . $body));
}
}
public static function RequestLog($url, $post_data, $mark, $code = 0) public static function RequestLog($url, $post_data, $mark, $code = 0)
{ {

@ -217,8 +217,12 @@ select combo_id as c_id,count(*) as count from orders where status in(2,4) group
$item_ids = request('item_ids'); //自选项目ids $item_ids = request('item_ids'); //自选项目ids
$duo_xuan_yi = request('duo_xuan_yi'); //多选1 $duo_xuan_yi = request('duo_xuan_yi'); //多选1
$group_id = request('group_id'); //团检登记id $group_id = request('group_id'); //团检登记id
$wj_flag= request('wj'); //问卷标记
if (!isset($hospital_id)) return \Yz::echoError1("医院id不能为空"); if (!isset($hospital_id)) return \Yz::echoError1("医院id不能为空");
$hospital = DB::table('hospitals')->where(['id' => 1, 'status' => 1, 'is_del' => 0])->first(); $hospital = DB::table('hospitals')->where(['id' => 1, 'status' => 1, 'is_del' => 0])->first();
if(isset($wj_flag) and $wj_flag==1){
$wj_zhekou=config('app.globals.Wj_ZheKou');//问卷过来的折扣率
}
$combo_info = false;//套餐信息 $combo_info = false;//套餐信息
$pay_item_count = 0;//需自费项目个数 $pay_item_count = 0;//需自费项目个数
$all_original_price = 0; $all_original_price = 0;
@ -320,13 +324,12 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
} }
$items_info = false;//自选项目信息 $items_info = false;//自选项目信息
if (isset($item_ids) and !empty($item_ids)) { if (isset($item_ids) and !empty($item_ids)) {
$price = 0; $item_price = 0;
$items_original_price = 0; $items_original_price = 0;
$items = DB::table('items')->whereIn('item_id', $item_ids)->where(['status' => 1])->get(); $items = DB::table('items')->whereIn('item_id', $item_ids)->where(['status' => 1])->get();
$groupedData = []; $groupedData = [];
foreach ($items as $item) { foreach ($items as $item) {
// $price=$price+$item->price; $item_price = bcadd($item_price, $item->price, 2);
$price = bcadd($price, $item->price, 2);
// $all_original_price+=$item->original_price; // $all_original_price+=$item->original_price;
$all_original_price = bcadd($all_original_price, $item->original_price, 2); $all_original_price = bcadd($all_original_price, $item->original_price, 2);
// $items_original_price+=$item->original_price; // $items_original_price+=$item->original_price;
@ -345,7 +348,11 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
]; ];
} }
} }
$items_info['price'] = $price; if(isset($wj_flag) and $wj_flag==1){
$item_price=$item_price*$wj_zhekou;
}
$items_info['price'] =number_format($item_price, 2, '.', '') ;
$items_info['original_price'] = $items_original_price; $items_info['original_price'] = $items_original_price;
foreach ($groupedData as $keshiName => $children) { foreach ($groupedData as $keshiName => $children) {
$items_info['items'][] = [ $items_info['items'][] = [
@ -355,6 +362,7 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
} }
$pay_item_count += count($items); $pay_item_count += count($items);
$true_price += $items_info['price']; $true_price += $items_info['price'];
} }
//调用his接口查询用户积分和预存款计算可以抵扣的金额 //调用his接口查询用户积分和预存款计算可以抵扣的金额
$integral_money = 90;//积分抵扣金额 $integral_money = 90;//积分抵扣金额

@ -2,6 +2,7 @@
namespace App\Http\Controllers\API\H5; namespace App\Http\Controllers\API\H5;
use App\Http\Controllers\API\AspNetZhuanController;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use DateTime; use DateTime;
use Illuminate\Http\Request; use Illuminate\Http\Request;
@ -14,16 +15,31 @@ class NMRController extends Controller
{ {
$hospital_id =request('hospital_id'); $hospital_id =request('hospital_id');
$month=request('month'); $month=request('month');
$list=[
[ // 获取给定月份的第一天
'date'=>'2024-10-18', $firstDayOfMonth = date('Y-m-01', strtotime($month));
'count'=>20, // 获取给定月份的最后一天
], $lastDayOfMonth = date('Y-m-t', strtotime($month));
[ $today = date('Y-m-d');
'date'=>'2024-10-19', $days = [];
'count'=>10, for ($date = $firstDayOfMonth; $date <= $lastDayOfMonth; $date = date('Y-m-d', strtotime($date . ' +1 day'))) {
], // 如果当前日期大于或等于今天的日期,则添加到数组中
if ($date >= $today) {
$days[] = $date;
}
}
$aspnet=new AspNetZhuanController();
$list=[];
$nmr=$aspnet::GetNmrList(['yyid'=>6,'data'=>$days],uniqid());
//获取每日数量
foreach($nmr as $k=>$v){
$list[]=[
'date'=>$k,
'count'=>count($v)
]; ];
}
//获取整月日期 //获取整月日期
// 获取当月的第一天 // 获取当月的第一天
$firstDay = date("Y-m-d", strtotime($month . "-01")); $firstDay = date("Y-m-d", strtotime($month . "-01"));
@ -66,45 +82,66 @@ class NMRController extends Controller
$dateTimeClone->modify("$i days"); // 修改日期 $dateTimeClone->modify("$i days"); // 修改日期
$days7[] = $dateTimeClone->format('Y-m-d'); // 按照需要的格式添加到结果数组 $days7[] = $dateTimeClone->format('Y-m-d'); // 按照需要的格式添加到结果数组
} }
$list=[
[
'id'=>1,
'status'=>1,
'time'=>'10:15'
],
[
'id'=>1,
'status'=>1,
'time'=>'10:45'
]
];
$weeklist=[[
'date'=>'2024-09-28',
'count'=>20,
]
]; $aspnet=new AspNetZhuanController();
$week7=[]; $week7=[];
$k=0; $nmr=$aspnet::GetNmrList(['yyid'=>6,'data'=>$days7],uniqid());
foreach ($days7 as $date) { //获取每日数量
$xingqi=\App\Lib\Tools::GetWeekName($date); foreach($nmr as $k=>$v){
$xingqi=\App\Lib\Tools::GetWeekName($k);
$week7[]=[ $week7[]=[
'date'=>$date, 'date'=>$k,
'count'=>0, 'count'=>count($v),
'xingqi'=>$xingqi 'xingqi'=>$xingqi
]; ];
foreach ($weeklist as $plan) {
if($plan['date'] == $date){
$week7[$k]=[
'date'=>$date,
'xingqi'=>$xingqi,
'count'=>$plan['count']
];
break;
} }
$list=[];
if(isset($nmr[$date])){
foreach($nmr[$date] as $k=>$v){
$list[]=[
'id'=>$v['TimeNum'],
'time'=>$v['Time'],
'status'=>$v['State'],
];
} }
$k++;
} }
// $list=[
// [
// 'id'=>1,
// 'status'=>1,
// 'time'=>'10:15'
// ],
// [
// 'id'=>1,
// 'status'=>1,
// 'time'=>'10:45'
// ]
// ];
// $week7=[];
// $k=0;
// foreach ($days7 as $date) {
// $xingqi=\App\Lib\Tools::GetWeekName($date);
// $week7[]=[
// 'date'=>$date,
// 'count'=>0,
// 'xingqi'=>$xingqi
// ];
// foreach ($weeklist as $plan) {
// if($plan['date'] == $date){
// $week7[$k]=[
// 'date'=>$date,
// 'xingqi'=>$xingqi,
// 'count'=>$plan['count']
// ];
// break;
// }
// }
// $k++;
// }
return \Yz::Return(true,"查询完成",['list'=>$list,'weeklist'=>$week7]); return \Yz::Return(true,"查询完成",['list'=>$list,'weeklist'=>$week7]);
} }
} }

@ -71,6 +71,11 @@ class OrderController extends Controller
$type = request('type');//1个检2团检 $type = request('type');//1个检2团检
$group_id = request('group_id');//团检id $group_id = request('group_id');//团检id
$item_ids = request('item_ids');//自选item的ids $item_ids = request('item_ids');//自选item的ids
if (count($item_ids) != 0 and $item_ids[0]=="") {
$item_ids=[];
}
$duo_xuan_yi = request('duo_xuan_yi'); //多选1 $duo_xuan_yi = request('duo_xuan_yi'); //多选1
$plan_id = request('plan_id');//号源id $plan_id = request('plan_id');//号源id
$plan_nmr_id = request('plan_nmr_id');//核磁号源id $plan_nmr_id = request('plan_nmr_id');//核磁号源id
@ -79,6 +84,11 @@ class OrderController extends Controller
$jifen = request('jifen',0); //使用的积分数量 $jifen = request('jifen',0); //使用的积分数量
$yucunkuan = request('yucunkuan',0);//使用的预存款数量 $yucunkuan = request('yucunkuan',0);//使用的预存款数量
$wj_flag= request('wj'); //问卷标记
if(isset($wj_flag) and $wj_flag==1){
$wj_zhekou=config('app.globals.Wj_ZheKou');//问卷过来的折扣率
}
if (!isset($hospital_id)) return \Yz::echoError1('医院id不能为空'); if (!isset($hospital_id)) return \Yz::echoError1('医院id不能为空');
if (!isset($openid)) return \Yz::echoError1('openid不能为空'); if (!isset($openid)) return \Yz::echoError1('openid不能为空');
if (!isset($person_id)) return \Yz::echoError1('person_id不能为空'); if (!isset($person_id)) return \Yz::echoError1('person_id不能为空');
@ -170,8 +180,9 @@ class OrderController extends Controller
if (count($item_ids) != 0 ) { if (count($item_ids) != 0 ) {
$items_list = DB::table('items')->whereIn('item_id', $item_ids)->where(['status' => 1])->get(); $items_list = DB::table('items')->whereIn('item_id', $item_ids)->where(['status' => 1])->get();
$existingIds = []; $existingIds = [];
$item_price=0;
foreach ($items_list as $item) { foreach ($items_list as $item) {
$price += $item->price; $item_price+=$item->price;
$existingIds[] = $item->item_id; $existingIds[] = $item->item_id;
$buy_info['items'][] = [ $buy_info['items'][] = [
'id' => $item->item_id, 'id' => $item->item_id,
@ -186,6 +197,10 @@ class OrderController extends Controller
]; ];
} }
} }
if(isset($wj_flag) and $wj_flag==1){
$item_price=$item_price*$wj_zhekou;
}
$price += $item_price;
$missingIds = array_diff($item_ids, $existingIds); $missingIds = array_diff($item_ids, $existingIds);
if (count($missingIds) > 0) return \Yz::echoError1("部分自选项目不可用Id:" . implode(', ', $missingIds)); if (count($missingIds) > 0) return \Yz::echoError1("部分自选项目不可用Id:" . implode(', ', $missingIds));
} }
@ -194,6 +209,7 @@ class OrderController extends Controller
$buy_info['items']=array_merge($buy_info['items'],$Nx1_arrInfo); $buy_info['items']=array_merge($buy_info['items'],$Nx1_arrInfo);
} }
$true_price = $price; $true_price = $price;
//如果是团检 //如果是团检
$group_info = false; $group_info = false;
if ($type == 2) { if ($type == 2) {
@ -347,6 +363,7 @@ class OrderController extends Controller
'sex' => $person->sex, 'sex' => $person->sex,
'birthday' => $person->birthday, 'birthday' => $person->birthday,
'married' => $person->married, 'married' => $person->married,
'wj_flag'=>$wj_flag,
'created_at' =>$now_datetime, 'created_at' =>$now_datetime,
]; ];
DB::beginTransaction(); DB::beginTransaction();
@ -506,10 +523,29 @@ class OrderController extends Controller
"预约时间" => $order_info->appointment_date . ' ' . $order_info->appointment_time, "预约时间" => $order_info->appointment_date . ' ' . $order_info->appointment_time,
"介绍人" => $order_info->referral, "介绍人" => $order_info->referral,
'套餐Id' => $order_info->combo_id == 0 ? null : $order_info->combo_id, '套餐Id' => $order_info->combo_id == 0 ? null : $order_info->combo_id,
"可选项目信息" => $item_arr,
"已收费" => true, "已收费" => true,
];
$cad2=[
"可选项目信息" => $item_arr,
"总计金额" => $order_info->price, "总计金额" => $order_info->price,
]; ];
if($order_info->wj_flag == 1){
$temp=[];
foreach ($item_arr as $k => $item) {
$temp[]=[
"Id"=> $item['Id'],
"已收费"=>$item['已收费'],
"优惠方式"=>"打折",
"优惠值"=> config('app.globals.Wj_ZheKou')
];
}
$cad2=[
"可选项目信息" => $temp,
];
}
$cad=array_merge($cad,$cad2);
} else { } else {
$cad = [ $cad = [
'type' => 2, 'type' => 2,

@ -122,7 +122,7 @@ class QuestionnairesLogsController extends Controller
$sum = DB::table('items')->whereIn('item_id', $items)->where('status', 1)->sum('price'); $sum = DB::table('items')->whereIn('item_id', $items)->where('status', 1)->sum('price');
$check_sum = DB::table('items')->whereIn('item_id', $check_items['items'])->where('status', 1)->sum('price'); $check_sum = DB::table('items')->whereIn('item_id', $check_items['items'])->where('status', 1)->sum('price');
$combo = DB::table('combos')->whereIn('combo_id', [$check_items['combo']])->where('status', 1)->sum('price'); $combo = DB::table('combos')->whereIn('combo_id', [$check_items['combo']])->where('status', 1)->sum('price');
$zhekou = 1; $zhekou = config('app.globals.Wj_ZheKou');
return number_format($combo + (($sum + $check_sum) * $zhekou), 2, '.', ''); return number_format($combo + (($sum + $check_sum) * $zhekou), 2, '.', '');
} }
public function submit(Request $request) public function submit(Request $request)

@ -2,6 +2,7 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Http\Controllers\API\AspNetZhuanController;
use App\Services\OrderService; use App\Services\OrderService;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
@ -12,6 +13,18 @@ class TestController extends Controller
echo DB::table('users')->count(); echo DB::table('users')->count();
//$order= new OrderService(); //$order= new OrderService();
// dd($order->DepartmentItemCount(33)); // dd($order->DepartmentItemCount(33));
$aspnet=new AspNetZhuanController();
$temp_list=[];
$nmr=$aspnet::GetNmrList(['yyid'=>6,'data'=>['2024-10-25']],uniqid());
//获取每日数量
foreach($nmr as $k=>$v){
$temp_list[]=[
'date'=>$k,
'count'=>count($v)
];
}
dd($temp_list);
} }
public function ApiTest(){ public function ApiTest(){

@ -8,6 +8,7 @@ return [
'PayNotifyUrl' =>"http://124.225.137.54:39080/h5/#/pages/main/order/CheckPay",//支付完成后小程序跳转H5路径 'PayNotifyUrl' =>"http://124.225.137.54:39080/h5/#/pages/main/order/CheckPay",//支付完成后小程序跳转H5路径
// 'Env'=>'pro', // 'Env'=>'pro',
'Env'=>'dev', 'Env'=>'dev',
'Wj_ZheKou'=>1,
], ],
/* /*

@ -51,6 +51,7 @@ const buttonClick = (info) => {
if (info.id) { if (info.id) {
$store.setCheckupTypeId({ id: info.id }); $store.setCheckupTypeId({ id: info.id });
} }
$store.setComboContrast([]); //
uni.navigateTo({ uni.navigateTo({
url: info.url, url: info.url,
}); });

@ -281,7 +281,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="botm_blank_wrapper" style="font-size: 18rpx;color: #ccc;">10171926</view> <view class="botm_blank_wrapper" style="font-size: 18rpx;color: #ccc;">10210900</view>
</view> </view>
</view> </view>
</template> </template>

@ -35,6 +35,7 @@ onShow(() => {
const toDetails = (type) => { const toDetails = (type) => {
let url = ""; let url = "";
if (type == 1) { if (type == 1) {
$store.setComboContrast([]); //
url = "/pages/main/combo/combo?groupId=" + groupInfo.value.group_id; url = "/pages/main/combo/combo?groupId=" + groupInfo.value.group_id;
} else { } else {
url = "/pages/main/tj/tjzx?groupId=" + groupInfo.value.group_id; url = "/pages/main/tj/tjzx?groupId=" + groupInfo.value.group_id;
@ -58,7 +59,10 @@ const toDetails = (type) => {
> >
<view class="px-15rpx pt-10rpx"> <view class="px-15rpx pt-10rpx">
<view class="flex items-center"> <view class="flex items-center">
<image src="@/static/assets/userm.png" class="w-70rpx h-70rpx mr-35rpx" /> <image
src="@/static/assets/userm.png"
class="w-70rpx h-70rpx mr-35rpx"
/>
<view class="flex items-center grow"> <view class="flex items-center grow">
<text class="text-#707070 text-24rpx">您好</text> <text class="text-#707070 text-24rpx">您好</text>
<text class="text-#0E0E0E text-32rpx">{{ groupInfo.name }}</text> <text class="text-#0E0E0E text-32rpx">{{ groupInfo.name }}</text>
@ -148,7 +152,10 @@ const toDetails = (type) => {
</view> --> </view> -->
</view> </view>
<view class="mt-30rpx pt-35rpx px-25rpx pb-200rpx box-border bg-#fff"> <view class="mt-30rpx pt-35rpx px-25rpx pb-200rpx box-border bg-#fff">
<view v-if="groupInfo.tongshou_xiane" class="mb-70rpx bg-#FFF8EB text-center text-#DA9616 text-24rpx py-22rpx"> <view
v-if="groupInfo.tongshou_xiane"
class="mb-70rpx bg-#FFF8EB text-center text-#DA9616 text-24rpx py-22rpx"
>
<text>本次团队体检您有</text> <text>本次团队体检您有</text>
<text class="text-#239EA3">{{ groupInfo.tongshou_xiane }}</text> <text class="text-#239EA3">{{ groupInfo.tongshou_xiane }}</text>
<text>体检额度</text> <text>体检额度</text>
@ -156,27 +163,25 @@ const toDetails = (type) => {
<text>我们提供如下两种方式供您自由选择</text> <text>我们提供如下两种方式供您自由选择</text>
</view> </view>
<view> <view>
<view class="py-30rpx pl-50rpx pr-130rpx between box-border rounded-15rpx shadow-[0px_1rpx_4rpx_0px_rgba(0,164,172,0.16)]" @click="toDetails(1)"> <view
class="py-30rpx pl-50rpx pr-130rpx between box-border rounded-15rpx shadow-[0px_1rpx_4rpx_0px_rgba(0,164,172,0.16)]"
@click="toDetails(1)"
>
<view class="center w-82rpx h-82rpx"> <view class="center w-82rpx h-82rpx">
<image class="w-40rpx h-40rpx" src="@/static/assets/taocan.png" /> <image class="w-40rpx h-40rpx" src="@/static/assets/taocan.png" />
</view> </view>
<text class="text-#000000 text-32rpx">按套餐选择</text> <text class="text-#000000 text-32rpx">按套餐选择</text>
<uni-icons <uni-icons type="right" color="#595757" size="26"></uni-icons>
type="right"
color="#595757"
size="26"
></uni-icons>
</view> </view>
<view class="py-30rpx mt-70rpx pl-50rpx pr-130rpx between box-border rounded-15rpx shadow-[0px_1rpx_4rpx_0px_rgba(0,164,172,0.16)]" @click="toDetails(2)"> <view
class="py-30rpx mt-70rpx pl-50rpx pr-130rpx between box-border rounded-15rpx shadow-[0px_1rpx_4rpx_0px_rgba(0,164,172,0.16)]"
@click="toDetails(2)"
>
<view class="center w-82rpx h-82rpx"> <view class="center w-82rpx h-82rpx">
<image class="w-40rpx h-40rpx" src="@/static/assets/xiangmu.png" /> <image class="w-40rpx h-40rpx" src="@/static/assets/xiangmu.png" />
</view> </view>
<text class="text-#000000 text-32rpx">按项目选择</text> <text class="text-#000000 text-32rpx">按项目选择</text>
<uni-icons <uni-icons type="right" color="#595757" size="26"></uni-icons>
type="right"
color="#595757"
size="26"
></uni-icons>
</view> </view>
</view> </view>
</view> </view>

Loading…
Cancel
Save