ApplysAction.php 644 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace App\Admin\Actions\Service;
  3. use App\Models\Docter;
  4. use Encore\Admin\Actions\RowAction;
  5. use App\Models\Serviceapplys;
  6. use Illuminate\Database\Eloquent\Model;
  7. use PHPUnit\Util\Filter;
  8. class ApplysAction extends RowAction
  9. {
  10. public $name = '通过';
  11. public function handle(Model $model)
  12. {
  13. // $model ...
  14. Serviceapplys::where('id',$model->id)->update(['status'=>2]);
  15. $filter = [1=>'is_chat',2=>'is_phone',3=>'is_appoint'];
  16. Docter::where('id',$model->docter_id)->update([$filter[$model->service_type]=>1]);
  17. return $this->response()->success('审核通过')->refresh();
  18. }
  19. }