Selaa lähdekoodia

定时任务与认证,取消订单模板消息添加

whj 4 vuotta sitten
vanhempi
commit
e9ee7259db

+ 14 - 16
app/Admin/Actions/Community/Docter/Failed.php

xqd
@@ -17,31 +17,29 @@ class Failed extends RowAction
     public $name = '驳回';
     public function handle()
     {
-        $openid = 'oflME5eixHMij2TIVyy52WbfaQvA';
+        $openid = $this->row->docter->openid;
 
         $data = [
-              $openid,
-              '很抱歉,你的医生身份认证失败!',
-              $this->row->docter->name,
-              $this->row->organization->name,
-              $this->row->qualification->name,
-              $this->row->office->name,
+            $openid,
+            '',
+            '很抱歉,你的医生身份认证失败!',
+            $this->row->docter->name,
+            $this->row->organization->name,
+            $this->row->qualification->name,
+            $this->row->office->name,
+            '点击进入小程序查看详情,有疑问请联系管理员!'
         ];
+
         DB::beginTransaction();
         try {
 
             DocterOrganization::where('id',$this->row->id)->update(['state'=>2]);
-            $docter_id = $this->row->docter_id;
-            $ret = send_wechatSubscription_message('then_reminder',$data);
-            dd($ret);
-
-//            Docter::where(['id'=>$docter_id])->update(['is_then'=
-//            ewWm59p1oVpHw7vt3LlkQTWpYgOZ_h6rfINUiTc4GbM
-              $data = [
-
-              ];
+            if(!empty($openid)){
+                admin_send_docter_message('then_result',$data);
+            }
             DB::commit();
         } catch (Exception $e){
+            dd($e->getMessage());
             DB::rollBack();
             return $this->response()->error('操作失败');
         }

+ 20 - 1
app/Admin/Actions/backstage/Pass.php

xqd xqd
@@ -18,6 +18,7 @@ class Pass extends RowAction
 //         $model ...
 //        dd($model);
         //判定通过认证的数量
+
         $is_pass_num = 0;
         //查询认证表里有多少条记录
         $docter_approve_num = DocterOrganization::where('docter_id',$model->docter_id)->get();
@@ -67,7 +68,25 @@ class Pass extends RowAction
                 Serviceapplys::insert($total_arr);
             }
         }
+
+        //发送认证结果提示
+        $openid = $this->row->docter->openid;
+
+        $data = [
+            $openid,
+            '',
+            '恭喜你,你的医生身份认证已通过',
+            $this->row->docter->name,
+            $this->row->organization->name,
+            $this->row->qualification->name,
+            $this->row->office->name,
+            '点击进入小程序查看详情'
+        ];
+        if(!empty($openid)){
+            admin_send_docter_message('then_result',$data);
+        }
+
         return $this->response()->success('审核通过')->refresh();
     }
 
-}
+}

+ 17 - 1
app/Admin/Actions/backstage/Refuse.php

xqd
@@ -14,7 +14,23 @@ class Refuse extends RowAction
         // $model ...
         DocterOrganization::where('id',$model->id)->update(['state'=>2,'authentication_time'=>0,'authentication_end_time'=>0]);
 
+        $openid = $this->row->docter->openid;
+
+        $data = [
+            $openid,
+            '',
+            '很抱歉,你的医生身份认证失败!',
+            $this->row->docter->name,
+            $this->row->organization->name,
+            $this->row->qualification->name,
+            $this->row->office->name,
+            '点击进入小程序查看详情,有疑问请联系管理员!'
+        ];
+        if(!empty($openid)){
+            admin_send_docter_message('then_result',$data);
+        }
+
         return $this->response()->success('审核驳回')->refresh();
     }
 
-}
+}

+ 14 - 1
app/Admin/Actions/backstage/Revoke.php

xqd
@@ -35,7 +35,20 @@ class Revoke extends RowAction
             DocterOrganization::where('id',$model->id)->update(['state'=>0,'authentication_time'=>0,'authentication_end_time'=>0]);
             Docter::where('id',$model->docter_id)->update(['is_then'=>0]);
         }
+
+        $openid = $this->row->docter->openid;
+
+        //发送消息
+        $data = [
+            $openid,
+            $this->row->organization->name,
+            date('Y-m-d H:i:s',time())
+        ];
+        if(!empty($openid)){
+           $ret =  admin_send_docter_message('out_then_reminder',$data);
+        }
+
         return $this->response()->success('审核撤销成功')->refresh();
     }
 
-}
+}

+ 14 - 5
app/Community/Actions/Clinc/OrderCancel.php

xqd
@@ -16,20 +16,29 @@ class OrderCancel extends RowAction
         $id = $this->row->id;
         $sn = $this->row->order_sn;
         $openid = $this->row->orderUser->openid;
+//        $openid = 'oYmUA5A1OIqtpA1XSrw35tbjtv1w';
         if(empty($openid)) return true;
-        //$openid = 'oYmUA5A1OIqtpA1XSrw35tbjtv1w';
         $time = $this->row->created_at;
-        $price = (intval($this->row->price) / 100).'元';
+        $price = (intval($this->row->total_amount) / 100);
+        $pantient = $this->row->orderPatient->name;
+        $organization = $this->row->organization->name;
+        $paystatus = Order::getPayStatus()[$this->row->payment_status];
+
         DB::beginTransaction();
         try {
             //退还余额
-            $res = Order::orderCancel($id);
+            $res = Order::orderCancel($id,'社区取消');
             $msg = [
-                $openid,'/pages/index/index','您有一个订单已取消',$sn,'门诊订单',$price,$time,'社区取消','如有疑问请联系客服'
+                $openid,$sn,'门诊预约',$price,$time,$pantient,$organization,'社区取消',$paystatus
+            ];
+            $miniMsg = [
+                $openid,$sn,'社区取消','门诊预约',$paystatus
             ];
-            $ret = send_wechat_message(9,$msg,'','');
+            //发送消息
+            $ret = admin_send_wechat_message(1,$msg,$miniMsg);
             DB::commit();
         } catch ( \Exception $e){
+            dd($e->getMessage());
             DB::rollBack();
             return $this->response()->error('操作失败!');
         }

+ 13 - 5
app/Community/Actions/Nurse/OrderCance.php

xqd xqd
@@ -3,6 +3,7 @@
 namespace App\Community\Actions\Nurse;
 
 use App\Models\Order;
+use App\Models\Organization;
 use App\Models\User;
 use Encore\Admin\Actions\RowAction;
 use Illuminate\Database\Eloquent\Model;
@@ -19,19 +20,26 @@ class OrderCance extends RowAction
         $sn = $order->order_sn;
         if(empty($order->orderUser) || empty($order->orderUser->openid) ) return true;
         $openid = $order->orderUser->openid;
-        //$openid = 'oYmUA5A1OIqtpA1XSrw35tbjtv1w';
+//        $openid = 'oYmUA5A1OIqtpA1XSrw35tbjtv1w';
         $time = $this->row->created_at;
-        $price = (intval($this->row->price) / 100).'元';
+        $price = ($this->row->total_amount / 100);
+
+        $pantient = $this->row->patients->name;
+        $organization = Organization::where(['id'=>$this->row->orders->organization_id])->value('name');
+        $paystatus = Order::getPayStatus()[$this->row->orders->payment_status];
 
         DB::beginTransaction();
         try {
             //退还余额
             $res = Order::orderCancel($id,'社区取消');
             $msg = [
-                $openid,'/pages/index/index','您有一个订单已取消',$sn,'儿保订单',$price,$time,'社区取消','如有疑问请联系客服'
+                $openid,$sn,'儿保预约',$price,$time,$pantient,$organization,'社区取消',$paystatus
             ];
-            $ret = send_wechat_message(9,$msg,'','');
-
+            $miniMsg = [
+                $openid,$sn,'社区取消','儿保预约',$paystatus
+            ];
+            //用户和医生都要发
+            $ret = admin_send_wechat_message(1,$msg,$miniMsg);
             DB::commit();
         } catch ( \Exception $e){
             dump($e->getMessage());

+ 14 - 5
app/Community/Actions/Vaccine/OrderCance.php

xqd
@@ -17,21 +17,30 @@ class OrderCance extends RowAction
         $id = $this->row->id;
         $sn = $this->row->order_sn;
         $openid = $this->row->orderUser->openid;
+//        $openid = 'oYmUA5A1OIqtpA1XSrw35tbjtv1w';
         if(empty($openid)) return true;
-        //$openid = 'oYmUA5A1OIqtpA1XSrw35tbjtv1w';
         $time = $this->row->created_at;
-        $price = (intval($this->row->price) / 100).'元';
+        $price = (intval($this->row->total_amount) / 100);
+        $pantient = $this->row->orderPatient->name;
+        $organization = $this->row->organization->name;
+        $paystatus = Order::getPayStatus()[$this->row->payment_status];
 
         DB::beginTransaction();
         try {
             //退还余额
-            $res = Order::orderCancel($id);
+            $res = Order::orderCancel($id,'社区取消');
             $msg = [
-                $openid,'/pages/index/index','您有一个订单已取消',$sn,'疫苗接种订单',$price,$time,'社区取消','如有疑问请联系客服'
+                $openid,$sn,'疫苗接种预约',$price,$time,$pantient,$organization,'社区取消',$paystatus
             ];
-            $ret = send_wechat_message(9,$msg,'','');
+            $miniMsg = [
+                $openid,$sn,'社区取消','疫苗接种预约',$paystatus
+            ];
+            //发送消息
+            $ret = admin_send_wechat_message(1,$msg,$miniMsg);
+
             DB::commit();
         } catch ( \Exception $e){
+            dd($e->getMessage());
             DB::rollBack();
             return $this->response()->error('操作失败!');
         }

+ 3 - 3
app/Community/Controllers/OrderController.php

xqd
@@ -73,9 +73,9 @@ class OrderController extends AdminController
             });
         })->placeholder('请输入用户姓名');
         $grid->actions(function ($actions) {
-            if(!empty($actions->row->order_status) && $actions->row->order_status < 2){
-                $actions->add(new Reserved());
-            }
+//            if(!empty($actions->row->order_status) && $actions->row->order_status < 2){
+//                $actions->add(new Reserved());
+//            }
             if(!empty($actions->row->order_status) && $actions->row->order_status<= 3){
                 $actions->add(new OrderCancel());
                 $actions->add(new Finished());

+ 3 - 3
app/Community/Controllers/OrderNurseController.php

xqd
@@ -96,9 +96,9 @@ class OrderNurseController extends AdminController
         });
 
         $grid->actions(function ($actions) {
-            if(!empty($actions->row->orders) && $actions->row->orders->order_status < 2){
-                $actions->add(new Reserved());
-            }
+//            if(!empty($actions->row->orders) && $actions->row->orders->order_status < 2){
+//                $actions->add(new Reserved());
+//            }
             if(!empty($actions->row->orders) && $actions->row->orders->order_status<= 3){
                 $actions->add(new OrderCance());
                 $actions->add(new Finished());

+ 3 - 5
app/Community/Controllers/OrderVaccinesController.php

xqd
@@ -86,11 +86,9 @@ class OrderVaccinesController extends AdminController
             $tools->append(new FasteOrder());
         });
         $grid->actions(function ($actions) {
-//            $actions->add(new AddOrder());
-            if( $actions->row->order_status<= 2 ){
-                $actions->add(new Reserved());
-                $actions->add(new OrderCance());
-            }
+//            if( $actions->row->order_status<= 2){
+//                $actions->add(new Reserved());
+//            }
 
             if(!empty($actions->row->order_status) &&  $actions->row->order_status<= 3 ){
                 $actions->add(new Finished());

+ 5 - 3
app/Console/Commands/ScheduleNotice.php

xqd xqd xqd
@@ -22,7 +22,7 @@ class ScheduleNotice extends Command
      *
      * @var string
      */
-    protected $description = '排班提醒';
+    protected $description = '排班提醒 每周六18:00 提醒一次';
 
     /**
      * Create a new command instance.
@@ -41,7 +41,7 @@ class ScheduleNotice extends Command
      */
     public function handle()
     {
-        //门诊医生排班
+        //门诊医生排班提醒
         $docters = Docter::where(['type'=>1])->get();
         $nowDay = intval(date('N',time()));
         $endDay = (7-$nowDay)*86400 +time();
@@ -49,8 +49,10 @@ class ScheduleNotice extends Command
         foreach ($docters as $d){
             if(empty($d->openid)) continue;
             $teams = get_docter_organization($d->id);
+            //$openid = 'oflME5eixHMij2TIVyy52WbfaQvA';
             $data = [$d->openid,'',$d->name,$time, $teams];
-            $ret = send_wechatSubscription_message('schedule_notice',$data);
+            $ret = admin_send_docter_message('schedule_notice',$data);
+            dd($ret);
         }
 
     }

+ 79 - 4
app/Console/Commands/overTimeOrder.php

xqd xqd xqd xqd
@@ -2,6 +2,7 @@
 
 namespace App\Console\Commands;
 
+use App\Models\DocterOrganization;
 use App\Models\Order;
 use App\Models\SystemConfig;
 use Illuminate\Console\Command;
@@ -14,7 +15,7 @@ class overTimeOrder extends Command
      *
      * @var string
      */
-    protected $signature = 'overOrder';
+    protected $signature = 'order {type}';
 
     /**
      * The console command description.
@@ -40,7 +41,83 @@ class overTimeOrder extends Command
      */
     public function handle()
     {
-        Log::info('超时命令'.date('Y-m-d H:is',time()).PHP_EOL);
+        $type = $this->argument('type');
+        if(!in_array($type,['orderOut','appiontOut','thenOut','thenLose'])){
+            dd('请输入正确的参数');
+        }
+        if($type == 'orderOut'){
+            //订单超时
+            $this->overTimeOrers();
+        } else if($type == 'appiontOut'){
+            //预约超时
+            $this->AppointReminder();
+        }else if($type == 'thenOut'){
+            //认证到期
+            $this->OutThenReminder();
+        }else if($type == 'thenLose'){
+            //认证失效
+            $this->InvalidThenReminder();
+        }
+        dd('ok');
+    }
+
+    /**
+    * 	确认超时提醒 当天的预约订单,医生还未点击完成的订单,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']]);
+                }
+            }
+        }
+    }
+
+    /**
+     * 签约失效提醒
+     * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
+     * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
+     * @throws \GuzzleHttp\Exception\GuzzleException
+     */
+    public function InvalidThenReminder(){
+        $list = DocterOrganization::with('docter','organization')->get();
+        if($list){
+            foreach ($list as $k=>$v){
+                if ($v['docter']['openid']&& time()>=strtotime($v['authentication_end_time'])){
+                    $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']))]);
+                }
+            }
+        }
+
+    }
+
+
+    /**
+     * 认证到期提醒
+     * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
+     * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
+     * @throws \GuzzleHttp\Exception\GuzzleException
+     */
+    public function OutThenReminder(){
+        $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)){
+                    $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']))]);
+                }
+            }
+        }
+    }
+
+    /**
+     * 订单超时自动完成(定时)
+     */
+    public function overTimeOrers(){
         $config_chat =  SystemConfig::get('docter_config','chat_complete_time');
         $config_phone =  SystemConfig::get('docter_config','phone_complete_time');
 
@@ -67,13 +144,11 @@ class overTimeOrder extends Command
             }
 
         }
-
         if ($catNewIds || $menNewIds){
             // 操作图文和电话订单为已完成
             Order::whereIn('id',$catNewIds)->update(['order_status'=>4]);
             // 操作门诊订单为已超时
             Order::whereIn('id',$menNewIds)->update(['order_status'=>6]);
         }
-
     }
 }

+ 3 - 1
app/Console/Kernel.php

xqd xqd
@@ -3,6 +3,7 @@
 namespace App\Console;
 
 use App\Console\Commands\overTimeOrder;
+use App\Console\Commands\packExpiredCheck;
 use Illuminate\Console\Scheduling\Schedule;
 use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
 
@@ -15,8 +16,9 @@ class Kernel extends ConsoleKernel
      */
     protected $commands = [
         //
-        'overOrder'=>overTimeOrder::class,
+        'order'=>overTimeOrder::class,
         'scheduleNotice'=>overTimeOrder::class,
+        'packExpiredCheck'=>packExpiredCheck::class,
     ];
 
     /**

+ 49 - 0
app/Helpers/functions.php

xqd
@@ -590,3 +590,52 @@ if (!function_exists('get_docter_organization')) {
         return implode(',',$name);
     }
 }
+
+//后台发送微信消息
+if (!function_exists('admin_send_wechat_message')) {
+    function admin_send_wechat_message($type, $official_arr, $subscribe_arr = [])
+    {
+        try {
+            $app = Factory::miniProgram(config('config.wechat_small_program'));
+            //先发送模板消息
+            $data = config('notice.wechat_official_message_template')[$type];
+            $json = json_encode($data, JSON_UNESCAPED_UNICODE);
+            $json = vsprintf($json, $official_arr);
+            $data = json_decode($json, true);
+            $ret = $app->uniform_message->send($data);
+            //如果模板消息发送失败(可能因用户没有关注公众号而失败)再发送订阅消息
+            if (!empty($subscribe_arr) && isset($ret['errcode']) && $ret['errcode'] != 0) {
+                $data = config('notice.wechat_subscribe_message_template')[$type];
+                $json = json_encode($data, JSON_UNESCAPED_UNICODE);
+                $json = vsprintf($json, $subscribe_arr);
+                $data = json_decode($json, true);
+                $ret = $app->subscribe_message->send($data);
+                if (isset($ret['errcode']) && $ret['errcode'] != 0) {
+                    trace(['发送微信订阅消息失败,请求参数' => $data ?? '', '返回数据' => $ret ?? ''], 'error');
+                }
+            }
+        } catch (Exception $e) {
+            trace(['发送微信消息失败' => $e->getMessage(), '请求参数' => $data ?? '', '返回数据' => $ret ?? ''], 'error');
+        }
+
+        return $ret ?? false;
+    }
+}
+
+// 后台医生端发送公众号模板消息方法
+if (!function_exists('admin_send_docter_message')) {
+    function admin_send_docter_message($type, $arr)
+    {
+        try {
+            $app = Factory::miniProgram(config('notice.docter_wechat_small_program'));
+            $data = config('notice.wechatSubscription_template')[$type];
+            $json = json_encode($data, JSON_UNESCAPED_UNICODE);
+            $json = vsprintf($json, $arr);
+            $data = json_decode($json, true);
+            $result = $app->uniform_message->send($data);
+        } catch (Exception $e) {
+            trace(['发送微信模板消息失败' => $e->getMessage(), '请求参数' => $data ?? '', '返回数据' => $result ?? ''], 'error');
+        }
+        return $result ?? false;
+    }
+}

+ 422 - 0
config/notice.php

xqd
@@ -0,0 +1,422 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: zilongs
+ * Date: 20-9-23
+ * Time: 上午11:41
+ */
+
+return [
+
+    'wechat_small_program' => [
+        'app_id' => env('WECHAT_APPID', 'wx6131f74e623bf6bf'),
+        'secret' => env('WECHAT_APPSECRET', 'b703596ab6cbcad5b74eb51fec2aeb0b'),
+    ],
+
+    'docter_wechat_small_program' => [
+        'app_id' => env('DOCTOR_WECHAT_APPID', 'wx92066f7587c34617'),
+        'secret' => env('DOCTOR_WECHAT_APPSECRET', 'bd7849c5259b79c41ec158173c5fb1d6'),
+    ],
+
+
+
+    'wechat_official_program' => [
+        'app_id' => env('OFFICIAL_WECHAT_APPID'),
+        'secret' => env('OFFICIAL_WECHAT_APPSECRET'),
+    ],
+
+
+    //公众号模板消息
+    'wechat_official_message_template' => [
+        //订单取消提醒
+        1 => [
+            'touser' => '%s',
+            'mp_template_msg' => [
+                'appid' => env('OFFICIAL_WECHAT_APPID'),
+                'template_id' => 'xYAvY_xez7Ou_qflGuPV7L277FCPpj3K-zFdRcUYaBI',
+                'url' => '',
+                'miniprogram' => [
+                    'appid' => env('WECHAT_APPID', 'wx6131f74e623bf6bf'),
+                    'page' => '',
+                ],
+                'data' => [
+                    'first' => [
+                        'value' => '尊敬的用户,你有一笔订单已取消!',
+                    ],
+                    'keyword1' => [
+                        'value' => '%s',
+                    ],
+                    'keyword2' => [
+                        'value' => '%s',
+                    ],
+                    'keyword3' => [
+                        'value' => '%s元',
+                    ],
+                    'keyword4' => [
+                        'value' => '%s',
+                    ],
+                    'keyword5' => [
+                        'value' => '%s患者在%s的服务终止',
+                    ],
+                    'remark' => [
+                        'value' => '订单备注:%s; 支付状态:%s; 点击进入小程序查看相关详情,如有疑问,请联系我们',
+                    ],
+                ],
+            ],
+        ],
+        //服务包续费(即将到期)提醒
+        2 => [
+            'touser' => '%s',
+            'mp_template_msg' => [
+                'appid' => env('OFFICIAL_WECHAT_APPID'),
+                'template_id' => 'aqfqUZtxj8jrRQe5_rhjaoHCmtDUeDLRgVYVdTMTH2k',
+                'url' => '',
+                'miniprogram' => [
+                    'appid' => env('WECHAT_APPID', 'wx6131f74e623bf6bf'),
+                    'page' => '',
+                ],
+                'data' => [
+                    'first' => [
+                        'value' => '尊敬的用户,您有一个服务包即将到期!',
+                    ],
+                    'keyword1' => [
+                        'value' => '%s',
+                    ],
+                    'keyword2' => [
+                        'value' => '%s',
+                    ],
+                    'keyword3' => [
+                        'value' => '%s',
+                    ],
+                    'remark' => [
+                        'value' => '点击进入小程序查看详情',
+                    ],
+                ],
+            ],
+        ],
+        //服务包失效提醒
+        3 => [
+            'touser' => '%s',
+            'mp_template_msg' => [
+                'appid' => env('OFFICIAL_WECHAT_APPID'),
+                'template_id' => 'aqfqUZtxj8jrRQe5_rhjaoHCmtDUeDLRgVYVdTMTH2k',
+                'url' => '',
+                'miniprogram' => [
+                    'appid' => env('WECHAT_APPID', 'wx6131f74e623bf6bf'),
+                    'page' => '',
+                ],
+                'data' => [
+                    'first' => [
+                        'value' => '尊敬的用户,您有一个服务包已到期!',
+                    ],
+                    'keyword1' => [
+                        'value' => '%s',
+                    ],
+                    'keyword2' => [
+                        'value' => '%s',
+                    ],
+                    'keyword3' => [
+                        'value' => '%s',
+                    ],
+                    'remark' => [
+                        'value' => '点击进入小程序查看详情',
+                    ],
+                ],
+            ],
+        ],
+    ],
+
+    //小程序订阅消息
+    'wechat_subscribe_message_template' => [
+        //订单取消提醒
+        1 => [
+            'template_id' => 'bjZ-r79i8sl7zEtdttAtcCPZLkCgFSYHTNWnNVd1cG0',
+            'touser' => '%s',
+            'page' => '',
+            'data' => [
+                'character_string1' => [
+                    'value' => '%s',
+                ],
+                'name5' => [
+                    'value' => '社区管理员',
+                ],
+                'thing4' => [
+                    'value' => '%s',
+                ],
+                'thing7' => [
+                    'value' => '%s订单,支付状态:%s,有任何疑问,请联系管理员',
+                ],
+            ],
+        ],
+        //服务包续费(即将到期)提醒
+        2 => [
+            'template_id' => 'obCFv2gAnl_RaW-OlnZkjCfi6teT3LUaHxxInUkwLbw',
+            'touser' => '%s',
+            'page' => '',
+            'data' => [
+                'thing1' => [
+                    'value' => '%s',
+                ],
+                'date2' => [
+                    'value' => '%s',
+                ],
+                'thing4' => [
+                    'value' => '亲爱的%s,你的服务包即将失效',
+                ],
+                'phrase5' => [
+                    'value' => '已开通',
+                ],
+                'thing3' => [
+                    'value' => '点击“详情”进入小程序查看服务包详情信息',
+                ],
+            ],
+        ],
+        //服务包失效提醒
+        3 => [
+            'template_id' => 'obCFv2gAnl_RaW-OlnZkjCfi6teT3LUaHxxInUkwLbw',
+            'touser' => '%s',
+            'page' => '',
+            'data' => [
+                'thing1' => [
+                    'value' => '%s',
+                ],
+                'date2' => [
+                    'value' => '%s',
+                ],
+                'thing4' => [
+                    'value' => '亲爱的%s,你的服务包已失效',
+                ],
+                'phrase5' => [
+                    'value' => '已失效',
+                ],
+                'thing3' => [
+                    'value' => '点击“详情”进入小程序查看服务包详情信息
+',
+                ],
+            ],
+        ],
+    ],
+
+    // 线上公众号
+    'docter_wechat_officialAccount' => [
+        'app_id' => env('DOCTOR_OFFICIAL_WECHAT_APPID', 'wx6df68b725662f8a3'),
+        'secret' => env('DOCTOR_OFFICIAL_WECHAT_APPSECRET', '4f91ff06530833577eedcb0c0e111a57'),
+    ],
+
+    'wechatSubscription_template' => [
+        //认证结果
+        'then_result'=>[
+            'touser' => '%s',
+            'mp_template_msg' => [
+                'appid' => env('DOCTOR_OFFICIAL_WECHAT_APPID'),
+                'template_id' => 'ewWm59p1oVpHw7vt3LlkQTWpYgOZ_h6rfINUiTc4GbM',
+                'url' => '',
+                'miniprogram' => [
+                    'appid' => env('DOCTOR_WECHAT_APPID'),
+                    'page' => '%s',
+                ],
+                'data' => [
+                    'first' => [
+                        'value' => '%s',
+                    ]
+                    ,'keyword1' => [
+                        'value' => '%s',
+                    ],
+                    'keyword2' => [
+                        'value' => '%s',
+                    ],
+                    'keyword3' => [
+                        'value' => '%s',
+                    ],
+                    'keyword4' => [
+                        'value' => '%s',
+                    ],
+                    'remark' => [
+                        'value' => '%s',
+                    ],
+                ]
+            ],
+        ],
+
+        // 排班变更提醒
+        'schedule_reminder'=>[
+            'touser' => '%s',
+            'mp_template_msg' => [
+                'appid' => env('DOCTOR_OFFICIAL_WECHAT_APPID'),
+                'template_id' => 'OmNx3Tiu83KwMriLeYsWRbuLfIk1O5JZM1S_K8hdwN4',
+                'url' => '',
+                'miniprogram' => [
+                    'appid' => env('DOCTOR_WECHAT_APPID'),
+                    'page' => '%s',
+                ],
+                'data' => [
+                    'first' => [
+                        'value' => '您好,你的排班情况有所变动,请及时查看',
+                    ]
+                    ,'keyword1' => [
+                        'value' => '%s',
+                    ],
+                    'keyword2' => [
+                        'value' => '%s',
+                    ],
+                    'remark' => [
+                        'value' => '点击进入小程序查看详情,有疑问请联系客服',
+                    ],
+                ]
+            ],
+
+        ],
+        //排班提醒
+        'schedule_notice'=>[
+            'touser' => '%s',
+            'mp_template_msg' => [
+                'appid' => env('DOCTOR_OFFICIAL_WECHAT_APPID'),
+                'template_id' => 'Bd12nbwEtcrsN2IsVA2URiPH1qVGk3uyCemLyxBa-4U',
+                'url' => '',
+                'miniprogram' => [
+                    'appid' => env('DOCTOR_WECHAT_APPID'),
+                    'page' => '%s',
+                ],
+                'data' => [
+                    'first' => [
+                        'value' => '尊敬的%s,你下周的排班已经完成,具体如下!',
+                    ]
+                    ,'keyword1' => [
+                        'value' => '%s',
+                    ],
+                    'keyword2' => [
+                        'value' => '%s',
+                    ],
+                    'keyword3'=> [
+                        'value' => '总后台',
+                    ],
+                    'remark' => [
+                        'value' => '点击进入小程序查看详情,有疑问请联系客服',
+                    ]
+                ]
+            ],
+
+        ],
+
+        // 认证到期
+        'out_then_reminder'=>[
+            'touser' => '%s',
+            'mp_template_msg' => [
+                'appid' => env('DOCTOR_OFFICIAL_WECHAT_APPID'),
+                'template_id' => 'RhvT7gFJcFpUDAImkXIovBTOWZUYA7DirkMrwL0EzE0',
+                'url' => '',
+                'miniprogram' => [
+                    'appid' => env('DOCTOR_WECHAT_APPID'),
+                    'page' => '',
+                ],
+                'data' => [
+                    'first' => [
+                        'value' => '很抱歉,你在%s社区的认证已被撤销,请重新认证!',
+                    ]
+                    ,'keyword1' => [
+                        'value' => '认证撤销',
+                    ],
+                    'keyword2' => [
+                        'value' => '%s',
+                    ],
+                    'remark' => [
+                        'value' => '点击进入小程序查看详情,有疑问请联系管理员!',
+                    ],
+                ]
+            ],
+        ],
+        // 医生接单提醒
+        'receiving_reminder'=>[
+            'touser' => '%s',
+            'mp_template_msg' => [
+                'appid' => env('OFFICIAL_WECHAT_APPID'),
+                'template_id' => 'grtzjXaIQNMTI-UoxY8cakzVna4q65s6qqZFbW67rIk',
+                'url' => '',
+                'miniprogram' => [
+                    'appid' => env('WECHAT_APPID', 'wx6131f74e623bf6bf'),
+                    'page' => '%s',
+                ],
+                'data' => [
+                    'first' => [
+                        'value' => '尊敬的用户,你的咨询订单已被医生接单!',
+                    ]
+                    ,'keyword1' => [
+                        'value' => '%s',
+                    ],
+                    'keyword2' => [
+                        'value' => '%s',
+                    ],
+                    'keyword3' => [
+                        'value' => '%s',
+                    ],
+                    'keyword4' => [
+                        'value' => '%s',
+                    ],
+                    'remark' => [
+                        'value' => '点击进入小程序查看详情!',
+                    ],
+                ]
+            ],
+        ],
+        // 消息回复提醒
+        'reply_reminder'=>[
+            'touser' => '%s',
+            'mp_template_msg' => [
+                'appid' => env('OFFICIAL_WECHAT_APPID'),
+                'template_id' => '0T33vX4zLYSUbFH4NxEe_6Yt4b6m1AoanjpwvBbsRgE',
+                'url' => '',
+                'miniprogram' => [
+                    'appid' => env('WECHAT_APPID', 'wx6131f74e623bf6bf'),
+                    'page' => '%s',
+                ],
+                'data' => [
+                    'first' => [
+                        'value' => '你的咨询订单已被医生回复,请及时查看!',
+                    ]
+                    ,'keyword1' => [
+                        'value' => '%s',
+                    ],
+                    'keyword2' => [
+                        'value' => '%s',
+                    ],
+                    'keyword3' => [
+                        'value' => '%s',
+                    ],
+                    'remark' => [
+                        'value' => '点击进入小程序查看详情!',
+                    ],
+                ]
+            ],
+        ],
+        // 明日预约提醒
+        'today_reminder'=>[
+            'touser' => '%s',
+            'mp_template_msg' => [
+                'appid' => env('DOCTOR_OFFICIAL_WECHAT_APPID'),
+                'template_id' => 'sqRXeqYDHyzxQMu_mO7EroNPhVWUCs2wpbZMRdrrIYc',
+                'url' => '',
+                'miniprogram' => [
+                    'appid' => env('DOCTOR_WECHAT_APPID'),
+                    'page' => '%s',
+                ],
+                'data' => [
+                    'first' => [
+                        'value' => '尊敬的%s,您明天有新的门诊预约订单待处理!',
+                    ]
+                    ,'keyword1' => [
+                        'value' => '签约失效提醒',
+                    ],
+                    'keyword2' => [
+                        'value' => '%s',
+                    ],
+                    'keyword3' => [
+                        'value' => '就诊人数:%s个,就诊地点:%s医院',
+                    ],
+                    'remark' => [
+                        'value' => '点击进入小程序查看相关详情',
+                    ],
+                ]
+            ],
+        ],
+    ],
+];