123456789101112131415161718192021222324252627282930 |
- <?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(Request $request)
- {
- DB::beginTransaction();
- try {
- DocterOrganization::where('id',$this->row->id)->update(['state'=>2]);
- $docter_id = $this->row->docter_id;
- Docter::where(['id'=>$docter_id])->update(['is_then'=>0]);
- } catch (Exception $e){
- return $this->response->error('操作失败');
- }
- return $this->response->success('操作成功')->refresh();
- }
- }
|