|
@@ -253,6 +253,8 @@ class PatientController extends AuthController
|
|
DB::rollBack();
|
|
DB::rollBack();
|
|
return out('', 500, $e->getMessage());
|
|
return out('', 500, $e->getMessage());
|
|
}
|
|
}
|
|
|
|
+ $this->ReceivingReminderOK($find['id']);
|
|
|
|
+
|
|
|
|
|
|
$axbwhere['docter_id'] = $user['id'];
|
|
$axbwhere['docter_id'] = $user['id'];
|
|
$axbwhere['user_id'] = $find['user_id'];
|
|
$axbwhere['user_id'] = $find['user_id'];
|
|
@@ -262,7 +264,6 @@ class PatientController extends AuthController
|
|
$unlok = (new Commons())->unLokPhone($finds['xphone'], $finds['subs_id']);
|
|
$unlok = (new Commons())->unLokPhone($finds['xphone'], $finds['subs_id']);
|
|
Axb::where(['subs_id' => $finds['subs_id']])->delete();
|
|
Axb::where(['subs_id' => $finds['subs_id']])->delete();
|
|
}
|
|
}
|
|
- $this->ReceivingReminderOK($find['id']);
|
|
|
|
|
|
|
|
return out();
|
|
return out();
|
|
|
|
|
|
@@ -750,14 +751,17 @@ class PatientController extends AuthController
|
|
if ($v['product_type']==1){
|
|
if ($v['product_type']==1){
|
|
if ((time()-$v['receiving_time'])>=$config_chat){
|
|
if ((time()-$v['receiving_time'])>=$config_chat){
|
|
$catNewIds[$k] = $v['id'];
|
|
$catNewIds[$k] = $v['id'];
|
|
|
|
+ $this->ReceivingReminderOK($v['id']);
|
|
}
|
|
}
|
|
}else if($v['product_type']==2){
|
|
}else if($v['product_type']==2){
|
|
if ((time()-$v['receiving_time'])>=$config_phone){
|
|
if ((time()-$v['receiving_time'])>=$config_phone){
|
|
$catNewIds[$k] = $v['id'];
|
|
$catNewIds[$k] = $v['id'];
|
|
|
|
+ $this->ReceivingReminderOK($v['id']);
|
|
}
|
|
}
|
|
}else if($v['product_type']==3){
|
|
}else if($v['product_type']==3){
|
|
if ((time()-$v['receiving_time'])>=(1*60*60*24)){
|
|
if ((time()-$v['receiving_time'])>=(1*60*60*24)){
|
|
$menNewIds[$k] = $v['id'];
|
|
$menNewIds[$k] = $v['id'];
|
|
|
|
+ $this->AppointReminder($v['id']);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -849,18 +853,24 @@ class PatientController extends AuthController
|
|
/**
|
|
/**
|
|
* 确认超时提醒 当天的预约订单,医生还未点击完成的订单,23:00给医生发送提醒
|
|
* 确认超时提醒 当天的预约订单,医生还未点击完成的订单,23:00给医生发送提醒
|
|
*/
|
|
*/
|
|
- public function AppointReminder(){
|
|
|
|
-
|
|
|
|
- $beginToday=mktime(0,0,0,date('m'),date('d'),date('Y'));
|
|
|
|
- $endToday=mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1;
|
|
|
|
- $Order = Order::with(['orderPatient','docter','user'])->where(['order_status'=>3,'payment_status'=>2,'product_type'=>3])->whereBetween('receiving_time',[$beginToday,$endToday])->get();
|
|
|
|
- foreach ($Order as $k=>$v){
|
|
|
|
- if ($v['docter']){
|
|
|
|
- if ($v['docter']['openid']){
|
|
|
|
- $send = send_wechatSubscription_message('appoint_reminder',[$v['docter']['openid'], "pages/index/index",$v['order_sn'],$v['user']['nickname'],$v['user']['phone'],$v['created_at']]);
|
|
|
|
|
|
+ public function AppointReminder($id=''){
|
|
|
|
+ if (!empty($id)){
|
|
|
|
+ $Order = Order::with(['orderPatient','docter','user'])->where(['id'=>$id,'order_status'=>3,'payment_status'=>2])->first();
|
|
|
|
+ $send = send_wechatSubscription_message('appoint_reminder',[$Order['docter']['openid'], "pages/index/index",$Order['order_sn'],$Order['user']['nickname'],$Order['user']['phone'],$Order['created_at']]);
|
|
|
|
+ }else{
|
|
|
|
+ $beginToday=mktime(0,0,0,date('m'),date('d'),date('Y'));
|
|
|
|
+ $endToday=mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1;
|
|
|
|
+ $Order = Order::with(['orderPatient','docter','user'])->where(['order_status'=>3,'payment_status'=>2,'product_type'=>3])->whereBetween('receiving_time',[$beginToday,$endToday])->get();
|
|
|
|
+ foreach ($Order as $k=>$v){
|
|
|
|
+ if ($v['docter']){
|
|
|
|
+ if ($v['docter']['openid']){
|
|
|
|
+ $send = send_wechatSubscription_message('appoint_reminder',[$v['docter']['openid'], "pages/index/index",$v['order_sn'],$v['user']['nickname'],$v['user']['phone'],$v['created_at']]);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -891,7 +901,7 @@ class PatientController extends AuthController
|
|
$type,
|
|
$type,
|
|
$Order['total_amount'],
|
|
$Order['total_amount'],
|
|
$Order['created_at'],
|
|
$Order['created_at'],
|
|
- '',
|
|
|
|
|
|
+ '医生取消订单',
|
|
]);
|
|
]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -924,7 +934,7 @@ class PatientController extends AuthController
|
|
$type,
|
|
$type,
|
|
date('Y-m-d H:i',$Order['receiving_time']),
|
|
date('Y-m-d H:i',$Order['receiving_time']),
|
|
$Order['order_patient']['phone'],
|
|
$Order['order_patient']['phone'],
|
|
- ],['wechat_official_message_template','wechat_small_program']);
|
|
|
|
|
|
+ ],'wechat_small_program');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -948,7 +958,7 @@ class PatientController extends AuthController
|
|
$list['organization']['name'],
|
|
$list['organization']['name'],
|
|
$list['docter']['name'],
|
|
$list['docter']['name'],
|
|
$user['nickname'],
|
|
$user['nickname'],
|
|
- ],['wechat_official_message_template','wechat_small_program']);
|
|
|
|
|
|
+ ],'wechat_small_program');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -973,7 +983,7 @@ class PatientController extends AuthController
|
|
}
|
|
}
|
|
if ($list){
|
|
if ($list){
|
|
if ($openid){
|
|
if ($openid){
|
|
- $send = send_wechatSubscription_message('schedule_reminder',[$openid, "pages/index/index", $type, 'A社区']);
|
|
|
|
|
|
+ $send = send_wechatSubscription_message('schedule_reminder',[$openid, "pages/index/index", $type, '社区']);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1035,25 +1045,25 @@ class PatientController extends AuthController
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 明日预约提醒(未完成)
|
|
|
|
|
|
+ * 明日预约提醒 8点跑定时
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
|
|
* @throws \GuzzleHttp\Exception\GuzzleException
|
|
* @throws \GuzzleHttp\Exception\GuzzleException
|
|
*/
|
|
*/
|
|
public function TodayReminder(){
|
|
public function TodayReminder(){
|
|
- $list = DocterOrganization::with('docter','organization')->get();
|
|
|
|
|
|
+ $list = Order::with('docter','orderPatient','organization')->get();
|
|
if($list){
|
|
if($list){
|
|
foreach ($list as $k=>$v){
|
|
foreach ($list as $k=>$v){
|
|
- if ($v['docter']['openid']&& time()>=strtotime($v['authentication_end_time'])){
|
|
|
|
- $send = send_wechatSubscription_message('schedule_reminder', [
|
|
|
|
- '医生id',
|
|
|
|
|
|
+ if ($v['docter']['openid']&& date('Y-m-d',$v['order_patient']['appoint_start_time'])==date("Y-m-d",strtotime("+1 day"))){
|
|
|
|
+ $send = send_wechatSubscription_message('today_reminder', [
|
|
|
|
+ $v['docter']['openid'],
|
|
"pages/index/index",
|
|
"pages/index/index",
|
|
- '小刘',
|
|
|
|
- '类型',
|
|
|
|
- '人数',
|
|
|
|
- '医院',
|
|
|
|
|
|
+ $v['docter']['name'],
|
|
|
|
+ date("Y-m-d",strtotime("+1 day")),
|
|
|
|
+ "门诊预约",
|
|
|
|
+ count($list),
|
|
|
|
+ !empty($v['organization']['name'])?$v['organization']['name']:'',
|
|
]);
|
|
]);
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1082,7 +1092,7 @@ class PatientController extends AuthController
|
|
$type,
|
|
$type,
|
|
date('Y-m-d H:i',$Order['receiving_time']),
|
|
date('Y-m-d H:i',$Order['receiving_time']),
|
|
$Order['order_patient']['phone'],
|
|
$Order['order_patient']['phone'],
|
|
- ],['wechat_official_message_template','wechat_small_program']);
|
|
|
|
|
|
+ ],'wechat_small_program');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|