|
|
|
@ -3,6 +3,7 @@
|
|
|
|
namespace App\Http\Controllers\API\H5;
|
|
|
|
namespace App\Http\Controllers\API\H5;
|
|
|
|
|
|
|
|
|
|
|
|
use App\Http\Controllers\Controller;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
|
|
|
|
|
|
use App\Http\Controllers\API\PEISApiController;
|
|
|
|
use App\Services\ConfigService;
|
|
|
|
use App\Services\ConfigService;
|
|
|
|
use DateTime;
|
|
|
|
use DateTime;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
@ -100,7 +101,15 @@ 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
|
|
|
|
$plan_id = request('plan_id');//自选item的ids
|
|
|
|
$plan_id = request('plan_id');//号源id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset($hospital_id)) return \Yz::echoError1('医院id不能为空');
|
|
|
|
|
|
|
|
if (!isset($openid)) return \Yz::echoError1('openid不能为空');
|
|
|
|
|
|
|
|
if (!isset($person_id)) return \Yz::echoError1('person_id不能为空');
|
|
|
|
|
|
|
|
if (!isset($type)) return \Yz::echoError1('type体检类型不能为空');
|
|
|
|
|
|
|
|
if (!isset($plan_id)) return \Yz::echoError1('号源id不能为空');
|
|
|
|
|
|
|
|
if ($type == 2 and !isset($group_id)) return \Yz::echoError1('团检,group_id不能为空');
|
|
|
|
|
|
|
|
if ($type == 1 and isset($group_id)) return \Yz::echoError1('体检类型:个检 与group_id冲突');
|
|
|
|
|
|
|
|
|
|
|
|
$user = DB::table('web_users')->where(['openid' => $openid, 'status' => 1, 'is_del' => 0])->first();
|
|
|
|
$user = DB::table('web_users')->where(['openid' => $openid, 'status' => 1, 'is_del' => 0])->first();
|
|
|
|
if (!$user) return \Yz::echoError1('用户不存在');
|
|
|
|
if (!$user) return \Yz::echoError1('用户不存在');
|
|
|
|
@ -108,6 +117,7 @@ class OrderController extends Controller
|
|
|
|
if (!$person) return \Yz::echoError1('体检人不存在');
|
|
|
|
if (!$person) return \Yz::echoError1('体检人不存在');
|
|
|
|
$title = "自选项目";
|
|
|
|
$title = "自选项目";
|
|
|
|
$price = 0;
|
|
|
|
$price = 0;
|
|
|
|
|
|
|
|
$true_price = 0;//订单真实支付金额
|
|
|
|
$buy_info = [
|
|
|
|
$buy_info = [
|
|
|
|
'combo' => [
|
|
|
|
'combo' => [
|
|
|
|
'id' => 0,
|
|
|
|
'id' => 0,
|
|
|
|
@ -120,9 +130,12 @@ class OrderController extends Controller
|
|
|
|
],
|
|
|
|
],
|
|
|
|
];
|
|
|
|
];
|
|
|
|
//如果是套餐
|
|
|
|
//如果是套餐
|
|
|
|
|
|
|
|
$checkup_type_id = false; //体检类型id
|
|
|
|
if (isset($combo_id) and $combo_id <> 0) {
|
|
|
|
if (isset($combo_id) and $combo_id <> 0) {
|
|
|
|
$combo_info = DB::table('combos')->where(['combo_id' => $combo_id, 'status' => 1])->first();
|
|
|
|
$combo_info = DB::table('combos')->where(['combo_id' => $combo_id, 'status' => 1])->first();
|
|
|
|
if(!$combo_info) return \Yz::echoError1("套餐不存在");
|
|
|
|
if (!$combo_info) return \Yz::echoError1("套餐不存在");
|
|
|
|
|
|
|
|
if (!isset($combo_info->checkup_type_id)) return \Yz::echoError1("套餐未关联体检类型");
|
|
|
|
|
|
|
|
$checkup_type_id = $combo_info->checkup_type_id;
|
|
|
|
$price += $combo_info->price;
|
|
|
|
$price += $combo_info->price;
|
|
|
|
$title = $combo_info->name;
|
|
|
|
$title = $combo_info->name;
|
|
|
|
$buy_info['combo'] = [
|
|
|
|
$buy_info['combo'] = [
|
|
|
|
@ -136,83 +149,152 @@ class OrderController extends Controller
|
|
|
|
$items_list = [];
|
|
|
|
$items_list = [];
|
|
|
|
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 = [];
|
|
|
|
foreach ($items_list as $item) {
|
|
|
|
foreach ($items_list as $item) {
|
|
|
|
$price += $item->price;
|
|
|
|
$price += $item->price;
|
|
|
|
|
|
|
|
$existingIds[] = $item->item_id;
|
|
|
|
$buy_info['items'][] = [
|
|
|
|
$buy_info['items'][] = [
|
|
|
|
'id' => $item->item_id,
|
|
|
|
'id' => $item->item_id,
|
|
|
|
'name' => $item->name,
|
|
|
|
'name' => $item->name,
|
|
|
|
'price' => $item->price
|
|
|
|
'price' => $item->price
|
|
|
|
];
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$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) {
|
|
|
|
|
|
|
|
$P = new PersonController();
|
|
|
|
|
|
|
|
$data = [
|
|
|
|
|
|
|
|
'电话号码' => null,
|
|
|
|
|
|
|
|
'证件号码' => null,
|
|
|
|
|
|
|
|
'预约Id' => $group_id
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
$group_info = $P->group_info($hospital_id, $data);
|
|
|
|
|
|
|
|
$group_info = $group_info[0];
|
|
|
|
|
|
|
|
$buy_info['group'] = [
|
|
|
|
|
|
|
|
'id' => $group_id,
|
|
|
|
|
|
|
|
'combo_name' => $group_info['combo_name'],
|
|
|
|
|
|
|
|
'combo_id' => $group_info['combo_id'],
|
|
|
|
|
|
|
|
'group_name' => $group_info['group_name'],
|
|
|
|
|
|
|
|
'items' => $group_info['items'],
|
|
|
|
|
|
|
|
'group_id' => $group_info['group_id'],
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
$title = "单位团检" . $group_info['combo_name'];
|
|
|
|
|
|
|
|
$price = $price + $group_info['sixi_zong_ji_jin_e'];
|
|
|
|
|
|
|
|
$need_pay = ($price - $group_info['tongshou_xiane']) > 0 ? $price - $group_info['tongshou_xiane'] : 0;
|
|
|
|
|
|
|
|
//团检订单金额为减去统收后的金的
|
|
|
|
|
|
|
|
$price = $need_pay;
|
|
|
|
|
|
|
|
$true_price = $need_pay;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//调用思信接口判断各个项目是否可用
|
|
|
|
|
|
|
|
$check_items = [];
|
|
|
|
|
|
|
|
foreach ($item_ids as $item_id) {
|
|
|
|
|
|
|
|
$check_items[] = ['Id' => $item_id];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((isset($combo_id) and $combo_id <> 0) || count($check_items) != 0) {
|
|
|
|
|
|
|
|
$item_check = self::item_check($hospital_id, [
|
|
|
|
|
|
|
|
'人员信息列表' => [[
|
|
|
|
|
|
|
|
"序号" => 0,
|
|
|
|
|
|
|
|
"性别" => $person->sex == 1 ? '男' : '女',
|
|
|
|
|
|
|
|
"年龄" => floor((time() - strtotime($person->birthday)) / 86400 / 360),
|
|
|
|
|
|
|
|
"婚姻状态" => $person->married == 1 ? '已婚' : '未婚',
|
|
|
|
|
|
|
|
]],
|
|
|
|
|
|
|
|
'套餐Id' => $combo_id == 0 ? null : $combo_id,
|
|
|
|
|
|
|
|
'可选项目信息' => $check_items,
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
if (count($item_check['data']) != 1) {
|
|
|
|
|
|
|
|
return \Yz::echoError1("体检系统提示:" . $item_check['message']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//检查号源是否可用
|
|
|
|
|
|
|
|
$plan = new PlanController();
|
|
|
|
|
|
|
|
$plan_check = $plan->CheckPlan($plan_id, $hospital_id, $type, $person->sex, $price, $checkup_type_id);
|
|
|
|
|
|
|
|
if ($plan_check['status'] === false) return \Yz::echoError1($plan_check['msg']);
|
|
|
|
|
|
|
|
$plan = $plan_check['plan'];
|
|
|
|
|
|
|
|
|
|
|
|
//判断号源是否可用vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
|
|
//判断号源是否可用vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
|
|
$plan = DB::table('plans')->where(['id' => $plan_id, 'hospital_id' => $hospital_id, 'status' => 1, 'is_del' => 0])->first();
|
|
|
|
// $plan = DB::table('plans')->where(['id' => $plan_id, 'hospital_id' => $hospital_id, 'status' => 1, 'is_del' => 0])->first();
|
|
|
|
if (!$plan) return \Yz::echoError1("号源不可用");
|
|
|
|
// if (!$plan) return \Yz::echoError1("号源不可用");
|
|
|
|
//判断个检/团检类型
|
|
|
|
// //判断个检/团检类型
|
|
|
|
if ($plan->use_type <> 0 and $plan->use_type <> $type) {
|
|
|
|
// if ($plan->use_type <> 0 and $plan->use_type <> $type) {
|
|
|
|
$type_temp = '';
|
|
|
|
// $type_temp = '';
|
|
|
|
if ($plan->use_type == 1) $type_temp = '个检';
|
|
|
|
// if ($plan->use_type == 1) $type_temp = '个检';
|
|
|
|
if ($plan->use_type == 2) $type_temp = '团检';
|
|
|
|
// if ($plan->use_type == 2) $type_temp = '团检';
|
|
|
|
return \Yz::echoError1("此号源为" . $type_temp . "号源,不可用");
|
|
|
|
// return \Yz::echoError1("此号源为" . $type_temp . "号源,不可用");
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
//判断是否是预留号源
|
|
|
|
// //判断是否是预留号源
|
|
|
|
if ($plan->type <> 1) return \Yz::echoError1("此号源为预留号源,不可用");
|
|
|
|
// if ($plan->type <> 1) return \Yz::echoError1("此号源为预留号源,不可用");
|
|
|
|
//判断是否是vip
|
|
|
|
// //判断是否是vip
|
|
|
|
//判断性别
|
|
|
|
// //判断性别
|
|
|
|
if ($plan->sex <> 0 and $plan->sex <> $person->sex) return \Yz::echoError1("此号源性别与体检人性别不符,不可用");
|
|
|
|
// if ($plan->sex <> 0 and $plan->sex <> $person->sex) return \Yz::echoError1("此号源性别与体检人性别不符,不可用");
|
|
|
|
//判断体检类型checkup_type
|
|
|
|
// //判断体检类型checkup_type
|
|
|
|
//判断金额
|
|
|
|
// //判断金额
|
|
|
|
if ($plan->use_type == 1 and $plan->amount_limit1 <> 0) {
|
|
|
|
// if ($plan->use_type == 1 and $plan->amount_limit1 <> 0) {
|
|
|
|
if ($price < $plan->amount_limit1) return \Yz::echoError1("未达到此号源限制的金额,不可用");
|
|
|
|
// if ($price < $plan->amount_limit1) return \Yz::echoError1("未达到此号源限制的金额,不可用");
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
if ($plan->use_type == 2 and $plan->amount_limit2 <> 0) {
|
|
|
|
// if ($plan->use_type == 2 and $plan->amount_limit2 <> 0) {
|
|
|
|
if ($price < $plan->amount_limit2) return \Yz::echoError1("未达到此号源限制的金额,不可用");
|
|
|
|
// if ($price < $plan->amount_limit2) return \Yz::echoError1("未达到此号源限制的金额,不可用");
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
//判断时间是否过期
|
|
|
|
// //判断时间是否过期
|
|
|
|
$plan_datetime=$plan->date.' '.$plan->time;
|
|
|
|
// $plan_datetime = $plan->date . ' ' . $plan->time;
|
|
|
|
if($plan_datetime < date('Y-m-d H:i:s')) return \Yz::echoError1("号源已过期,不可用");
|
|
|
|
// if ($plan_datetime < date('Y-m-d H:i:s')) return \Yz::echoError1("号源已过期,不可用");
|
|
|
|
//判断号源是否可用^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
//判断号源是否可用^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//如果是团检 判断号源在 团检登记人的有效时间范围内
|
|
|
|
|
|
|
|
$plan_datetime = $plan->date . ' ' . $plan->time;
|
|
|
|
|
|
|
|
if (!!$group_info) {
|
|
|
|
|
|
|
|
if (!($plan_datetime > $group_info['start_time'] . ' 00:00:00' and $plan_datetime < $group_info['end_time'] . ' 23:59:59')) {
|
|
|
|
|
|
|
|
return \Yz::echoError1("预约日期不在单位有效时间范围内,请重新选择");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//构建订单号
|
|
|
|
//构建订单号
|
|
|
|
$order_num=$this->generateOrderNumber();
|
|
|
|
$order_num = $this->generateOrderNumber();
|
|
|
|
$data=[
|
|
|
|
$data = [
|
|
|
|
'title'=>$title,
|
|
|
|
'title' => $title,
|
|
|
|
'type'=>$type,
|
|
|
|
'type' => $type,
|
|
|
|
'web_user_id'=>$user->id,
|
|
|
|
'web_user_id' => $user->id,
|
|
|
|
'person_id'=>$person->id,
|
|
|
|
'person_id' => $person->id,
|
|
|
|
'name'=>$person->name,
|
|
|
|
'name' => $person->name,
|
|
|
|
'id_number'=>$person->id_number,
|
|
|
|
'id_number' => $person->id_number,
|
|
|
|
'buy_info'=>json_encode($buy_info, JSON_UNESCAPED_UNICODE),
|
|
|
|
'buy_info' => json_encode($buy_info, JSON_UNESCAPED_UNICODE),
|
|
|
|
'price'=>$price,
|
|
|
|
'price' => $price,
|
|
|
|
'true_price'=>$price,
|
|
|
|
'true_price' => $true_price,
|
|
|
|
'order_number'=>$order_num,
|
|
|
|
'order_number' => $order_num,
|
|
|
|
'status'=>1,
|
|
|
|
'status' => 1,
|
|
|
|
'appointment_date'=>$plan->date,
|
|
|
|
'appointment_date' => $plan->date,
|
|
|
|
'appointment_time'=>$plan->time,
|
|
|
|
'appointment_time' => $plan->time,
|
|
|
|
'plan_id'=>$plan->id,
|
|
|
|
'plan_id' => $plan->id,
|
|
|
|
'plan_number'=>$plan->plan_number,
|
|
|
|
'plan_number' => $plan->plan_number,
|
|
|
|
'combo_id'=>$combo_id,
|
|
|
|
'combo_id' => $combo_id,
|
|
|
|
'hospital_id'=>$hospital_id,
|
|
|
|
'hospital_id' => $hospital_id,
|
|
|
|
'phone'=>$person->phone,
|
|
|
|
'phone' => $person->phone,
|
|
|
|
'sex'=>$person->sex,
|
|
|
|
'sex' => $person->sex,
|
|
|
|
'birthday'=>$person->birthday,
|
|
|
|
'birthday' => $person->birthday,
|
|
|
|
'married'=>$person->married,
|
|
|
|
'married' => $person->married,
|
|
|
|
];
|
|
|
|
];
|
|
|
|
DB::beginTransaction();
|
|
|
|
DB::beginTransaction();
|
|
|
|
$insert=DB::table('orders')->insert($data);
|
|
|
|
$insert = DB::table('orders')->insert($data);
|
|
|
|
$up_plan=DB::table('plans')->where(['id'=>$plan->id,'status'=>1])->update([
|
|
|
|
$up_plan = DB::table('plans')->where(['id' => $plan->id, 'status' => 1])->update([
|
|
|
|
'status'=>2
|
|
|
|
'status' => 2
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
if($insert and $up_plan){
|
|
|
|
if ($insert and $up_plan) {
|
|
|
|
DB::commit();
|
|
|
|
DB::commit();
|
|
|
|
return \Yz::return(true,"操作成功",[]);
|
|
|
|
return \Yz::return(true, "操作成功", []);
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
DB::rollBack();
|
|
|
|
DB::rollBack();
|
|
|
|
return \Yz::echoError1('操作失败');
|
|
|
|
return \Yz::echoError1('操作失败');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function generateOrderNumber() {
|
|
|
|
function generateOrderNumber()
|
|
|
|
|
|
|
|
{
|
|
|
|
// 获取当前时间的时间戳(精确到毫秒)
|
|
|
|
// 获取当前时间的时间戳(精确到毫秒)
|
|
|
|
$timestamp = round(microtime(true) * 1000);
|
|
|
|
$timestamp = round(microtime(true) * 1000);
|
|
|
|
|
|
|
|
|
|
|
|
@ -224,4 +306,79 @@ class OrderController extends Controller
|
|
|
|
|
|
|
|
|
|
|
|
return $orderNumber;
|
|
|
|
return $orderNumber;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function item_check($hospital, $data)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$peis = new PEISApiController();
|
|
|
|
|
|
|
|
$check = $peis::Post('套餐项目检查', $hospital, $data);
|
|
|
|
|
|
|
|
return $check;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function Finish_test() //删除!!!
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
self::Finish('20240915183440999WMp2yu');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//最后步骤,开始通知思信预约
|
|
|
|
|
|
|
|
public function Finish($order_number)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$order_info = DB::table('orders')->where(['order_number' => $order_number, 'status' => 1])->first();
|
|
|
|
|
|
|
|
if (!$order_info) return ['status' => false, 'msg' => "未找到有效订单"];
|
|
|
|
|
|
|
|
$buy_info = json_decode($order_info->buy_info, true);
|
|
|
|
|
|
|
|
$combo_id = $buy_info['combo']['id'];
|
|
|
|
|
|
|
|
$item_arr = [];
|
|
|
|
|
|
|
|
foreach ($buy_info['items'] as $item) {
|
|
|
|
|
|
|
|
$item_arr[] = ['Id' => $item['id'], '已收费' => true];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//调用思信 套餐项目检查
|
|
|
|
|
|
|
|
if ((isset($combo_id) and $combo_id <> 0) || count($item_arr) != 0) {
|
|
|
|
|
|
|
|
$item_check = self::item_check($order_info->hospital_id, [
|
|
|
|
|
|
|
|
'人员信息列表' => [[
|
|
|
|
|
|
|
|
"序号" => 0,
|
|
|
|
|
|
|
|
"性别" => $order_info->sex == 1 ? '男' : '女',
|
|
|
|
|
|
|
|
"年龄" => floor((time() - strtotime($order_info->birthday)) / 86400 / 360),
|
|
|
|
|
|
|
|
"婚姻状态" => $order_info->married == 1 ? '已婚' : '未婚',
|
|
|
|
|
|
|
|
]],
|
|
|
|
|
|
|
|
'套餐Id' => $combo_id == 0 ? null : $combo_id,
|
|
|
|
|
|
|
|
'可选项目信息' => $item_arr,
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
if (count($item_check['data']) != 1) {
|
|
|
|
|
|
|
|
return \Yz::echoError1("体检系统提示:" . $item_check['message']);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//如果是个检
|
|
|
|
|
|
|
|
if ($order_info->type == 1) {
|
|
|
|
|
|
|
|
$cad = [
|
|
|
|
|
|
|
|
'type' => 1,
|
|
|
|
|
|
|
|
"姓名" => $order_info->name,
|
|
|
|
|
|
|
|
"性别" => $order_info->sex == 1 ? '男' : '女',
|
|
|
|
|
|
|
|
"年龄" => floor((time() - strtotime($order_info->birthday)) / 86400 / 360),
|
|
|
|
|
|
|
|
"婚姻状态" => $order_info->married == 1 ? '已婚' : '未婚',
|
|
|
|
|
|
|
|
"证件号码" => $order_info->id_number,
|
|
|
|
|
|
|
|
"电话号码" => $order_info->phone,
|
|
|
|
|
|
|
|
"预约时间" => $order_info->appointment_date . ' ' . $order_info->appointment_time,
|
|
|
|
|
|
|
|
"介绍人" => $order_info->referral,
|
|
|
|
|
|
|
|
'套餐Id' => $order_info->combo_id == 0 ? null : $order_info->combo_id,
|
|
|
|
|
|
|
|
"可选项目信息" => $item_arr,
|
|
|
|
|
|
|
|
"已收费" => true,
|
|
|
|
|
|
|
|
"总计金额" => $order_info->price,
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$cad = [
|
|
|
|
|
|
|
|
'type' => 2,
|
|
|
|
|
|
|
|
"预约Id" => $buy_info['group']['group_id'],
|
|
|
|
|
|
|
|
"预约时间" => $order_info->appointment_date . ' ' . $order_info->appointment_time,
|
|
|
|
|
|
|
|
'套餐Id' => null,
|
|
|
|
|
|
|
|
"可选项目信息" => $item_arr
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//更新订单状态为已支付, 支付流水号在 上一步(方法)更新,
|
|
|
|
|
|
|
|
DB::table('orders')->where(['order_number' => $order_number])->update([
|
|
|
|
|
|
|
|
'status' => 2,
|
|
|
|
|
|
|
|
'pay_time' => date('Y-m-d H:i:s'),
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
//先把状态更新为支付,然后再开始预约思信
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|