ApiController.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 自己 oVxTzvhu4gs4RyCt4kJDRWOgsUXw周璐 oVxTzvgu4XnI5F2aF7DcrbJIp5fI 间行 oVxTzvl8DYQblYmLCIK3UXW_8jAY 落雨桐
  53. $renyuan = ['oVxTzvhu4gs4RyCt4kJDRWOgsUXw','oVxTzvgYlGktIDZXwfLMLQ01Tr5s']; //周璐
  54. // $renyuan = ['oVxTzvvTnnbjEE9jsalOYj4mtp6U','oVxTzvgu4XnI5F2aF7DcrbJIp5fI']; //简行
  55. $app = Factory::officialAccount($config );
  56. // $res = $app->broadcasting->status(3147483751);
  57. //
  58. // "errcode" => 0
  59. // "errmsg" => "send job submission success"
  60. // "msg_id" => 3147483751
  61. // "msg_data_id" => 2247484953
  62. // ^ array:2 [▼
  63. // "errcode" => 40003
  64. // "errmsg" => "invalid openid rid: 5fc35ef3-7f3b3ef9-14537bc7"
  65. //]
  66. $user = $app->user->get('oVxTzvgYlGktIDZXwfLMLQ01Tr5s');
  67. dd($user);
  68. $res = $app->template_message->send([
  69. 'touser' => 'oVxTzvgYlGktIDZXwfLMLQ01Tr5s',
  70. 'template_id' => '3LUhWGlyiljxrT3Jh8orwQZ2LSHjfRs9SIHaB40O6q0',
  71. // 'url' => 'https://t5.9026.com',
  72. 'data' => [
  73. 'first'=>'社区通知',
  74. 'keyword1' => '王海军',
  75. 'keyword2' => 18719141830,
  76. 'keyword3' => '开发工程师',
  77. 'keyword4' => '思维定制',
  78. 'keyword5' => '2020-12-12',
  79. ],
  80. ]);
  81. dd($res);
  82. $res = $app->broadcasting->sendText("测试发送,测试发送",$renyuan);
  83. }
  84. public function getComSchedule()
  85. {
  86. $time = TimePeriod::get(['id','start_time_period','end_time_period']);
  87. dd($time);
  88. $data['community'] = [];
  89. $data['docter'] = [];
  90. }
  91. public function setDocChedule()
  92. {
  93. }
  94. }