123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace App\Community\Controllers;
- use App\Http\Controllers\Controller;
- use App\Models\Docter;
- use App\Models\PatientRemark;
- use EasyWeChat\Factory;
- class ApiController extends Controller
- {
- public function getDocter()
- {
- return Docter::get(['name as text','id'])->toArray();
- }
- public function paitent_remark()
- {
- $data['patient_id']= request('patient_id');
- $data['org_id'] = request('org_id');
- $is_have = PatientRemark::where($data)->first();
- $data['remark'] = request('remark');
- if($is_have){
- PatientRemark::where(['id'=>$is_have->id])->update(['remark'=>$data['remark']]);
- } else {
- PatientRemark::insert($data);
- }
- return redirect('/cdms/nurse_users');
- }
- public function sendmsg(){
- $config = [
- 'app_id' => 'wx1c2357232cd25f65',
- 'secret' => 'c8cab53e4e52234ed1bc2abbdeaba57d',
- // 'app_id' => 'wx13bedfcc62e9bab0',
- // 'secret' => '175e5518b6426dd12d3096f24ca68fb8',
- 'response_type' => 'array'
- // oVxTzvgYlGktIDZXwfLMLQ01Tr5s
- ];
- $renyuan = ['oVxTzvhu4gs4RyCt4kJDRWOgsUXw','oVxTzvgYlGktIDZXwfLMLQ01Tr5s']; //周璐
- $renyuan = ['oVxTzvvTnnbjEE9jsalOYj4mtp6U','oVxTzvgu4XnI5F2aF7DcrbJIp5fI']; //简行
- $app = Factory::officialAccount($config );
- $res = $app->broadcasting->sendText("大家好!欢迎使用 EasyWeChat。",$renyuan);
- dd($res);
- }
- }
|