1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace app\common\util;
- /**
- * APP消息类型
- */
- class AppMsg
- {
- // 短信模板
- const SMS_VERIFY = "您的验证码为:{#code},有效期为10分钟!"; // 短信验证模板
- const SMS_PH_DISPATCH = "{#name},有一个新的订单需要您及时处理,订单联系人:{#contact},订单联系电话:{#phone}。"; // 有陪护订单时给调度发消息提醒模板
- // 推送类型
- const PUSH_USER_ORDER_SEND = 1; //通知客户订单已派发
- const PUSH_WORKER_ORDER_SEND = 2; //通知员工有新派的订单
- const PUSH_USER_ORDER_FINISH = 3; //通知客户订单已完成
- const PUSH_CUSTOM = 4; //通知提醒,自定义内容
- const PUSH_WASTE_UNFINISH = 5; //医废未转运提醒
- const PUSH_PATROL = 6; //巡更任务提醒
- const PUSH_ORDER_ROB = 7; //抢单提醒工人
- const PUSH_CLEAN = 8; //专项保洁任务提醒
- const PUSH_PH_DISPATCH = 9; //有陪护订单时给调度发消息
- const PUSH_DAILY_TASK = 10; //日常工作任务提醒
- const PUSH_DEVICE_TASK = 11; //设备台账任务提醒
- const PUSH_COMPLAIN_TIMEOUT = 12; //投诉处理超时提醒
- const PUSH_COMPLAIN_FINISH = 13; //投诉已处理提醒投诉人
- const PUSH_INFORMER_USER = 14; //推送品控知会人提醒
- public static function getPushMsg($type,$msg=''){
- if($msg){
- return $msg;
- }
- $msgs = [
- 1 => '您提交的工单正在处理中',
- 2 => '您有新的任务需要处理',
- 3 => '您提交的订单已处理',
- 5 => '还有未转运订单未处理',
- 7 => '来新订单了,请及时抢单',
- 12 => '有投诉超时未处理,请知晓。',
- 13 => '您的投诉已处理,请知晓。',
- ];
- $msg = isset($msgs[$type])?$msgs[$type]:'';
- return $msg;
- }
- /**
- * 获取短信消息
- */
- public static function getSmsMsg($template,$params=[]){
- foreach ($params as $k=>$v){
- $search = '{#'.$k.'}';
- $template = str_ireplace($search,$v,$template);
- }
- return $template;
- }
- }
|