链街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.

39 lines
801 B

  1. <?php
  2. namespace App\Admin\Actions\Grid\v3;
  3. use Dcat\Admin\Grid\RowAction;
  4. use App\Models\v3\Coupon as CouponModel;
  5. class CouponForbidden extends RowAction
  6. {
  7. /**
  8. * @return string
  9. */
  10. protected $title = '禁用';
  11. public function handle()
  12. {
  13. $id = $this->getKey();
  14. $coupon = CouponModel::getInfo($id);
  15. if(!empty($coupon)){
  16. $coupon->status = 3;
  17. if($coupon->save()){
  18. return $this->response()->success('禁用成功!','/coupon');
  19. }
  20. }
  21. return $this->response()->success('禁用失败!');
  22. }
  23. // 确认弹窗信息
  24. public function confirm()
  25. {
  26. return '您确定要禁用吗?';
  27. }
  28. public function parameters()
  29. {
  30. return ['status'=>3];
  31. }
  32. }