1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace App\Admin\Actions\Community\Docter;
- use App\Models\Docter;
- use App\Models\DocterOrganization;
- use Encore\Admin\Actions\Action;
- use Encore\Admin\Actions\RowAction;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\DB;
- use Mockery\Exception;
- class Failed extends RowAction
- {
- protected $selector = '.failed';
- public $name = '驳回';
- public function handle()
- {
- $openid = 'oflME5eixHMij2TIVyy52WbfaQvA';
- $data = [
- $openid,
- '很抱歉,你的医生身份认证失败!',
- $this->row->docter->name,
- $this->row->organization->name,
- $this->row->qualification->name,
- $this->row->office->name,
- ];
- DB::beginTransaction();
- try {
- DocterOrganization::where('id',$this->row->id)->update(['state'=>2]);
- $docter_id = $this->row->docter_id;
- $ret = send_wechatSubscription_message('then_reminder',$data);
- dd($ret);
- // Docter::where(['id'=>$docter_id])->update(['is_then'=
- // ewWm59p1oVpHw7vt3LlkQTWpYgOZ_h6rfINUiTc4GbM
- $data = [
- ];
- DB::commit();
- } catch (Exception $e){
- DB::rollBack();
- return $this->response()->error('操作失败');
- }
- return $this->response()->success('操作成功')->refresh();
- }
- }
|