链街Dcat后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
877 B

  1. <?php
  2. namespace App\Admin\Actions\Grid\v3;
  3. use Dcat\Admin\Grid\RowAction;
  4. use Illuminate\Support\Facades\Redis;
  5. use App\Libs\Redis\RedisKey;
  6. use Illuminate\Http\Request;
  7. class ShareCardDelete extends RowAction
  8. {
  9. /**
  10. * @return string
  11. */
  12. protected $title = ' 删除 ';
  13. public function handle(Request $request)
  14. {
  15. $id = $request->get('id');
  16. $res = Redis::hdel(RedisKey::PROGRAM_SHARE_CARD ,$id);
  17. if($res !== false){
  18. return $this->response()->success('删除成功!','/share_card_setting');
  19. }else{
  20. return $this->response()->error('删除失败!');
  21. }
  22. }
  23. // 确认弹窗信息
  24. public function confirm()
  25. {
  26. return '您确定要删除吗?';
  27. }
  28. public function parameters()
  29. {
  30. return [
  31. 'id' => $this->row->id ?? 0
  32. ];
  33. }
  34. }