|
|
|
@ -768,38 +768,42 @@ class OrderNewController extends Controller
|
|
|
|
if($type==1){
|
|
|
|
if($type==1){
|
|
|
|
$AspZhuan = new AspNetZhuanController();
|
|
|
|
$AspZhuan = new AspNetZhuanController();
|
|
|
|
$targetTimes = [$date1, $date2];
|
|
|
|
$targetTimes = [$date1, $date2];
|
|
|
|
$orders = DB::table('orders')
|
|
|
|
$orders1 = DB::table('orders')
|
|
|
|
->where('status', 1)
|
|
|
|
->where('status', 1)
|
|
|
|
->whereIn(DB::raw('TIMESTAMP(appointment_date, appointment_time)'), $targetTimes)
|
|
|
|
->whereIn(DB::raw('TIMESTAMP(appointment_date, appointment_time)'), [$date1])
|
|
|
|
|
|
|
|
->where('source', 'like', '%线下体检预约%')
|
|
|
|
|
|
|
|
->where('offline_sendmsg_status', '<>', 2)
|
|
|
|
|
|
|
|
->get();
|
|
|
|
|
|
|
|
$orders2 = DB::table('orders')
|
|
|
|
|
|
|
|
->where('status', 1)
|
|
|
|
|
|
|
|
->whereIn(DB::raw('TIMESTAMP(appointment_date, appointment_time)'), [$date2])
|
|
|
|
->where('source', 'like', '%线下体检预约%')
|
|
|
|
->where('source', 'like', '%线下体检预约%')
|
|
|
|
->where('offline_sendmsg_status', '<>', 2)
|
|
|
|
->where('offline_sendmsg_status', '<>', 2)
|
|
|
|
->get();
|
|
|
|
->get();
|
|
|
|
$orderids=[];
|
|
|
|
$orderids=[];
|
|
|
|
foreach ($orders as $order) {
|
|
|
|
foreach ($orders1 as $order) {
|
|
|
|
$orderids[]=$order->id;
|
|
|
|
|
|
|
|
$offline_sendmsg_status=0;
|
|
|
|
$offline_sendmsg_status=0;
|
|
|
|
if($order->offline_sendmsg_status==0 or $order->offline_sendmsg_status==null or $order->offline_sendmsg_status==''){
|
|
|
|
if($order->offline_sendmsg_status==0 or $order->offline_sendmsg_status==null or $order->offline_sendmsg_status==''){
|
|
|
|
$offline_sendmsg_status=1;
|
|
|
|
$offline_sendmsg_status=1;
|
|
|
|
|
|
|
|
$orderids[]=$order->id;
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($order->offline_sendmsg_status==1){
|
|
|
|
|
|
|
|
|
|
|
|
DB::table('orders')->where(['id'=>$order->id])->update(['offline_sendmsg_status'=>$offline_sendmsg_status]);
|
|
|
|
|
|
|
|
$this->sendWXNotice($AspZhuan, $order);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($orders2 as $order) {
|
|
|
|
|
|
|
|
$offline_sendmsg_status=0;
|
|
|
|
|
|
|
|
if($order->offline_sendmsg_status<>2){
|
|
|
|
$offline_sendmsg_status=2;
|
|
|
|
$offline_sendmsg_status=2;
|
|
|
|
|
|
|
|
$orderids[]=$order->id;
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DB::table('orders')->where(['id'=>$order->id])->update(['offline_sendmsg_status'=>$offline_sendmsg_status]);
|
|
|
|
DB::table('orders')->where(['id'=>$order->id])->update(['offline_sendmsg_status'=>$offline_sendmsg_status]);
|
|
|
|
$person=DB::table('web_user_person')->where(['id_number'=>$order->id_number,'is_del'=>0])->first();
|
|
|
|
$this->sendWXNotice($AspZhuan, $order);
|
|
|
|
if(!$person) continue;
|
|
|
|
|
|
|
|
$reqst_data = [
|
|
|
|
|
|
|
|
'ghzid' => $person->ghzid,
|
|
|
|
|
|
|
|
'yyid' => 6,
|
|
|
|
|
|
|
|
'type' => 28,
|
|
|
|
|
|
|
|
'msg1' => $person['name'],
|
|
|
|
|
|
|
|
'msg2' => $order->title,
|
|
|
|
|
|
|
|
'msg3' => number_format($order->true_price, 2, '.', ''),
|
|
|
|
|
|
|
|
'msg4' => $order->appointment_date . ' ' . $order->appointment_time,
|
|
|
|
|
|
|
|
'msg5' => "健康管理中心",
|
|
|
|
|
|
|
|
'msg6' => "",
|
|
|
|
|
|
|
|
'url' => "pages/other/entry/index?path=/pages/other/jump-h5/index&src=https%3A%2F%2Ftj-h5.hnxdfe.com%2Fh5%2F%23%2Fpages%2Fmain%2Flogin%2Flogin%3Fpath%3Dorder&scene=1014",
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
$AspZhuan::WeiXinSend($reqst_data);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return \Yz::Return(true,"线下订单通知完成",['find_orderids'=>$orderids]);
|
|
|
|
return \Yz::Return(true,"线下订单通知完成",['find_orderids'=>$orderids]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -821,6 +825,30 @@ class OrderNewController extends Controller
|
|
|
|
return \Yz::Return(true,"线下订单自动取消完成",['find_orderids'=>$orderids]);
|
|
|
|
return \Yz::Return(true,"线下订单自动取消完成",['find_orderids'=>$orderids]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private function sendWXNotice($aspZhuan, $order)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$person = DB::table('web_user_person')
|
|
|
|
|
|
|
|
->where('id_number', $order->id_number)
|
|
|
|
|
|
|
|
->where('is_del', 0)
|
|
|
|
|
|
|
|
->first();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!$person) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$reqst_data = [
|
|
|
|
|
|
|
|
'ghzid' => $person->ghzid,
|
|
|
|
|
|
|
|
'yyid' => 6,
|
|
|
|
|
|
|
|
'type' => 28,
|
|
|
|
|
|
|
|
'msg1' => $person->name,
|
|
|
|
|
|
|
|
'msg2' => $order->title,
|
|
|
|
|
|
|
|
'msg3' => number_format($order->true_price, 2, '.', ''),
|
|
|
|
|
|
|
|
'msg4' => $order->appointment_date . ' ' . $order->appointment_time,
|
|
|
|
|
|
|
|
'msg5' => "健康管理中心",
|
|
|
|
|
|
|
|
'msg6' => "",
|
|
|
|
|
|
|
|
'url' => "pages/other/entry/index?path=/pages/other/jump-h5/index&src=https%3A%2F%2Ftj-h5.hnxdfe.com%2Fh5%2F%23%2Fpages%2Fmain%2Flogin%2Flogin%3Fpath%3Dorder&scene=1014",
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$aspZhuan::WeiXinSend($reqst_data);
|
|
|
|
|
|
|
|
}
|
|
|
|
public function item_check($hospital, $data)
|
|
|
|
public function item_check($hospital, $data)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$peis = new PEISApiController();
|
|
|
|
$peis = new PEISApiController();
|
|
|
|
|