| xqd
@@ -121,10 +121,16 @@ class overTimeOrder extends Command
|
|
|
$list = DocterOrganization::with('docter','organization')->get();
|
|
|
if($list){
|
|
|
foreach ($list as $k=>$v){
|
|
|
- if ($v['docter']['openid']&& time()>=strtotime($v['authentication_end_time'])){
|
|
|
- order_trace(['类型'=>'签约失效提醒','医生openid'=>$v['docter']['openid'],'记录时间'=>date('Ymd His',time())],'info');
|
|
|
-
|
|
|
- $send = send_wechatSubscription_message('out_then_reminder',[$v['docter']['openid'], "pages/index/index", $v['organization']['name'],date('Y-m-d',strtotime($v['authentication_end_time']))]);
|
|
|
+ if (!\Cache::has($v['id'].'-InvalidThenReminder')) {
|
|
|
+ if ($v['docter']['openid']&& time()>=strtotime($v['authentication_end_time'])){
|
|
|
+ order_trace(['类型'=>'签约失效提醒','医生openid'=>$v['docter']['openid'],'记录时间'=>date('Ymd His',time())],'info');
|
|
|
+ $send = send_wechatSubscription_message('out_then_reminder',[$v['docter']['openid'], "pages/index/index", $v['organization']['name'],date('Y-m-d',strtotime($v['authentication_end_time']))]);
|
|
|
+ if ($send){
|
|
|
+ \Cache::forever($v['id'].'-InvalidThenReminder',$v['id']);
|
|
|
+ }else{
|
|
|
+ order_trace(['公共方法发送微信模板消息失败', '请求类型' => 'InvalidThenReminder' ?? '', '返回数据' => $send ?? ''], 'error');
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
| xqd
@@ -141,10 +147,16 @@ class overTimeOrder extends Command
|
|
|
$list = DocterOrganization::with('docter','organization')->get();
|
|
|
if($list){
|
|
|
foreach ($list as $k=>$v){
|
|
|
- if ($v['docter']['openid']&& (strtotime($v['authentication_end_time'])-strtotime($v['authentication_time']))<=(1*60*60*24)){
|
|
|
- order_trace(['类型'=>'认证到期提醒','医生openid'=>$v['docter']['openid'],'记录时间'=>date('Ymd His',time())],'info');
|
|
|
-
|
|
|
- $send = send_wechatSubscription_message('out_then_reminder',[$v['docter']['openid'], "pages/index/index", $v['organization']['name'],date('Y-m-d',strtotime($v['authentication_end_time']))]);
|
|
|
+ if (!\Cache::has($v['id'].'-OutThenReminder')) {
|
|
|
+ if ($v['docter']['openid']&& (strtotime($v['authentication_end_time'])-strtotime($v['authentication_time']))<=(1*60*60*24)){
|
|
|
+ order_trace(['类型'=>'认证到期提醒','医生openid'=>$v['docter']['openid'],'记录时间'=>date('Ymd His',time())],'info');
|
|
|
+ $send = send_wechatSubscription_message('out_then_reminder',[$v['docter']['openid'], "pages/index/index", $v['organization']['name'],date('Y-m-d',strtotime($v['authentication_end_time']))]);
|
|
|
+ if ($send){
|
|
|
+ \Cache::forever($v['id'].'-OutThenReminder',$v['id']);
|
|
|
+ }else{
|
|
|
+ order_trace(['公共方法发送微信模板消息失败', '请求类型' => 'OutThenReminder' ?? '', '返回数据' => $send ?? ''], 'error');
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|