send_message.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. namespace app\common\library;
  3. use think\Db;
  4. class send_message extends AliyunSms{
  5. /*
  6. * 向上级医师发送[远程诊断申请]短信
  7. * 亲爱的${name}医生您好!收到新的${type},请您及时于${time}前登录系统处理
  8. * @param {string} phone 手机号码
  9. * @param {string} time 时间
  10. * @param {string} name 姓名(姓)
  11. */
  12. public static function sendSms2Apply($phone, $time = '', $name = '') {
  13. DB::table('send_message')->insert(['phone'=>$phone,'type'=>'远程申请','doctor'=>$name]);
  14. return self::sendSms($phone,"中世康恺","SMS_153325044",array("time" => $time,"name" => $name));
  15. }
  16. /*
  17. * 向下级医师发送[远程诊断申请被驳回]短信
  18. * 很抱歉,您发起的远程诊断申请被驳回,请您及时处理后重新发起申请。驳回原因:${description}
  19. * @param {string} description 驳回理由
  20. */
  21. public static function sendSms2RejectApply($phone, $description = '') {
  22. DB::table('send_message')->insert(['phone'=>$phone,'type'=>'申请驳回','content'=>$description]);
  23. return self::sendSms($phone,"中世康恺","SMS_153330722",array("description" => $description));
  24. }
  25. /*
  26. * 向下级医院发送[远程诊断报告已经被写完]短信
  27. * 您发起的远程诊断申请已由${doctor}医师完成,请您登录系统查看
  28. * @param {string} doctor 医生
  29. */
  30. public static function sendSms2CompleteReport($phone, $doctor = '') {
  31. DB::table('send_message')->insert(['phone'=>$phone,'type'=>'报告完成','doctor'=>$doctor]);
  32. return self::sendSms($phone,"中世康恺","SMS_153330824",array("doctor" => $doctor));
  33. }
  34. /*
  35. * 给患者发送短信
  36. * 通知: 类型:${code} 内容:${rid}
  37. * @param {string} code 发送的验证码
  38. * @param {string} rid 数据库中这一条信息的id share表
  39. */
  40. public static function sendSms2Patient($phone,$code = '', $rid = '') {
  41. return self::sendSms($phone,"中世康恺","SMS_181546061",array("code" => $code, "rid" => $rid));
  42. }
  43. /*
  44. * 发送[内部通知]短信
  45. * 通知: 类型:${type} 内容:${content}
  46. * @param {string} type 通知类型
  47. * @param {string} content 通知内容
  48. */
  49. public static function sendSms2Self($phone,$type = '', $content = '') {
  50. DB::table('send_message')->insert(['phone'=>$phone,'type'=>'内部通知'.$type,'content'=>$content]);
  51. return self::sendSms($phone,"中世康恺","SMS_153325903",array("t" => $type, "c" => $content));
  52. }
  53. /*
  54. * 发送[修改短信验证码]短信
  55. * 通知: 类型:${code} 验证码
  56. * @param {string} phone 手机号码
  57. * @param {string} code 验证码
  58. */
  59. public static function sendSms2UpDate($phone,$code) {
  60. DB::table('send_message')->insert(['phone'=>$phone,'type'=>'登录验证'.$code]);
  61. return self::sendSms($phone,"中世康恺","SMS_163620994",array("code" => $code));
  62. }
  63. /*
  64. * 发送[修改短信验证码]短信
  65. * 通知: 类型:${code} 验证码
  66. * @param {string} phone 手机号码
  67. * @param {string} code 验证码
  68. */
  69. public static function sendSms2Doctor($phone,$password) {
  70. return self::sendSms($phone,"中世康恺","SMS_182669508",array("phone" => $phone,"pass"=>$password));
  71. }
  72. }