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

52 lines
1.2 KiB

  1. <?php
  2. namespace App\Admin\Actions\Grid\v3;
  3. use Dcat\Admin\Grid\RowAction;
  4. use Dcat\Admin\Widgets\Modal;
  5. use App\Admin\Forms\v3\CouponPublishForm;
  6. use App\Admin\Forms\v3\CouponTimeForm;
  7. class CouponTime extends RowAction
  8. {
  9. /**
  10. * 修改优惠券活动时间
  11. * @return string
  12. */
  13. protected $title = ' 时间 ';
  14. public function render()
  15. {
  16. $id = $this->getKey();
  17. $modal = Modal::make()
  18. ->xl()
  19. ->title($this->title)
  20. ->body(CouponTimeForm::make()->setKey($id)->payload([
  21. 'id'=>$this->row->id,
  22. 'inventory'=>$this->row->inventory,
  23. 'title'=>$this->row->title,
  24. 'start_time'=>$this->row->start_time,
  25. 'end_time'=>$this->row->end_time,
  26. 'usable_start_time'=>$this->row->usable_start_time,
  27. 'usable_end_time'=>$this->row->usable_end_time,
  28. ]))
  29. ->button($this->title);
  30. return $modal;
  31. }
  32. // 确认弹窗信息
  33. public function confirm()
  34. {
  35. return '您确定要修改时间吗?';
  36. }
  37. public function parameters()
  38. {
  39. return [
  40. ];
  41. }
  42. }