ApiController.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. namespace App\Community\Controllers;
  3. use App\Http\Controllers\Controller;
  4. use App\Models\Docter;
  5. use App\Models\PatientRemark;
  6. use App\Models\Schedule;
  7. use App\Models\TimePeriod;
  8. use EasyWeChat\Factory;
  9. class ApiController extends Controller
  10. {
  11. public function getDocter()
  12. {
  13. return Docter::get(['name as text','id'])->toArray();
  14. }
  15. public function paitent_remark()
  16. {
  17. $data['patient_id']= request('patient_id');
  18. $data['org_id'] = request('org_id');
  19. $data['type'] = request('type');
  20. $is_have = PatientRemark::where($data)->first();
  21. $data['remark'] = request('remark');
  22. if($is_have){
  23. PatientRemark::where(['id'=>$is_have->id])->update(['remark'=>$data['remark']]);
  24. } else {
  25. PatientRemark::insert($data);
  26. }
  27. return redirect('/cdms/nurse_users');
  28. }
  29. public function sendmsg(){
  30. $config = [
  31. 'app_id' => 'wx1c2357232cd25f65',
  32. 'secret' => 'c8cab53e4e52234ed1bc2abbdeaba57d',
  33. // 'app_id' => 'wx13bedfcc62e9bab0',
  34. // 'secret' => '175e5518b6426dd12d3096f24ca68fb8',
  35. 'response_type' => 'array'
  36. // oVxTzvgYlGktIDZXwfLMLQ01Tr5s
  37. ];
  38. //3LUhWGlyiljxrT3Jh8orwQZ2LSHjfRs9SIHaB40O6q0
  39. //开发者调用模版消息接口时需提供模版ID
  40. //标题
  41. //offer进度提醒
  42. //行业
  43. //IT科技 - 互联网|电子商务
  44. //详细内容
  45. //{{first.DATA}}
  46. //人才姓名:{{keyword1.DATA}}
  47. //联系方式:{{keyword2.DATA}}
  48. //入职职位:{{keyword3.DATA}}
  49. //入职公司:{{keyword4.DATA}}
  50. //报到时间:{{keyword5.DATA}}
  51. //{{remark.DATA}}
  52. // oVxTzvgYlGktIDZXwfLMLQ01Tr5s 自己
  53. $renyuan = ['oVxTzvhu4gs4RyCt4kJDRWOgsUXw','oVxTzvgYlGktIDZXwfLMLQ01Tr5s']; //周璐
  54. $renyuan = ['oVxTzvvTnnbjEE9jsalOYj4mtp6U','oVxTzvgu4XnI5F2aF7DcrbJIp5fI']; //简行
  55. $app = Factory::officialAccount($config );
  56. $res = $app->template_message->send([
  57. 'touser' => 'oVxTzvgYlGktIDZXwfLMLQ01Tr5s',
  58. 'template_id' => '3LUhWGlyiljxrT3Jh8orwQZ2LSHjfRs9SIHaB40O6q0',
  59. 'url' => 'http://47.94.228.245',
  60. 'miniprogram' => [
  61. 'appid' => 'wx1c2357232cd25f65',
  62. 'pagepath' => 'pages/index/index',
  63. ],
  64. 'data' => [
  65. 'first'=>'社区通知',
  66. 'key1' => '模板消息发送',
  67. 'key2' => 18719141830,
  68. 'key3' => '开发工程师',
  69. 'key4' => '思维定制',
  70. 'key5' => '2020-12-12',
  71. ],
  72. ]);
  73. dd($res);
  74. $res = $app->broadcasting->sendText("大家好!欢迎使用 EasyWeChat。",$renyuan);
  75. dd($res);
  76. }
  77. public function getComSchedule()
  78. {
  79. $time = TimePeriod::get(['id','start_time_period','end_time_period']);
  80. dd($time);
  81. $data['community'] = [];
  82. $data['docter'] = [];
  83. }
  84. public function setDocChedule()
  85. {
  86. }
  87. }