调整 到检 推送 逻辑

main
yanzai 4 months ago
parent 7a7d7e24f9
commit de49bbe115

@ -23,16 +23,14 @@ class OrderController extends Controller
return $this->CreateOrder($exam_id); return $this->CreateOrder($exam_id);
} else { } else {
if (!!$exam_id) { if (!!$exam_id) {
if ($orderInfo->status == 1 and strpos($orderInfo->source, '线下体检预约') !== false ){
return $this->CreateOrder($exam_id,$orderInfo->id);
}
if ($orderInfo->status == 1) return \Yz::echoError1("订单未付款"); if ($orderInfo->status == 1) return \Yz::echoError1("订单未付款");
if ($orderInfo->status == 3) return \Yz::echoError1("订单已取消"); if ($orderInfo->status == 3) return \Yz::echoError1("订单已取消");
if ($orderInfo->status == 4 || $orderInfo->check_status == 2) return \Yz::echoError1("人员已经到检"); if ($orderInfo->status == 4 || $orderInfo->check_status == 2) return \Yz::echoError1("人员已经到检");
if ($orderInfo->status == 5) return \Yz::echoError1("订单已退款"); if ($orderInfo->status == 5) return \Yz::echoError1("订单已退款");
// $peis = new PEISApiController();
// $data = [
// "电话号码" => $orderInfo->phone,
// "证件号码" => $orderInfo->id_number,
// ];
// $info = $peis::Post('分诊查询体检号', $orderInfo->hospital_id,$data);
DB::table('orders')->where('id', $orderInfo->id)->update([ DB::table('orders')->where('id', $orderInfo->id)->update([
'status' => 4, 'status' => 4,
// 'tj_number'=>$info['data'][0]['体检号'], // 'tj_number'=>$info['data'][0]['体检号'],
@ -53,7 +51,7 @@ class OrderController extends Controller
} }
//根据体检号拉取数据进行存储 //根据体检号拉取数据进行存储
public function CreateOrder($exam_id) public function CreateOrder($exam_id,$order_id=0)
{ {
if (isset($exam_id)) { if (isset($exam_id)) {
$peis = new PEISApiController(); $peis = new PEISApiController();
@ -107,7 +105,18 @@ class OrderController extends Controller
'check_status' => 2, 'check_status' => 2,
'check_time' => $data['登记时间'], 'check_time' => $data['登记时间'],
]; ];
$insert = DB::table('orders')->insert($dataInfo); if($order_id>0){
if(empty($dataInfo['title'])){
$dataInfo['title']='自选项目';
}
unset($dataInfo['source']);
unset($dataInfo['person_id']);
unset($dataInfo['person_id']);
$insert = DB::table('orders')->where('id',$order_id)->update($dataInfo);
}else{
$insert = DB::table('orders')->insert($dataInfo);
}
if ($insert) { if ($insert) {
return \Yz::Return(true, "创建成功", ['id' => $insert]); return \Yz::Return(true, "创建成功", ['id' => $insert]);
} else { } else {
@ -198,7 +207,7 @@ class OrderController extends Controller
$save_data = [ $save_data = [
'title' => $res['套餐名称'], 'title' => $res['套餐名称'],
'type' => 1, 'type' => 1,
'source' => count($items)==0?'线下体检预约-空号源':'线下体检预约-项目', 'source' => (count($items)==0 and empty($combo_id))?'线下体检预约-空号源':'线下体检预约-项目',
'checkup_type_id' => $checkup_type_id, 'checkup_type_id' => $checkup_type_id,
'person_id' => 0, 'person_id' => 0,
'name' => $res['姓名'], 'name' => $res['姓名'],

Loading…
Cancel
Save