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

54 lines
1.3 KiB

5 years ago
  1. <?php
  2. namespace App\Admin\Forms;
  3. use App\Models\ImsCjdcOrderMain;
  4. use Dcat\Admin\Widgets\Form;
  5. use Symfony\Component\HttpFoundation\Response;
  6. class RefundNote extends Form
  7. {
  8. /**
  9. * Handle the form request.
  10. *
  11. * @param array $input
  12. *
  13. * @return Response
  14. */
  15. public function handle(array $input)
  16. {
  17. $note = request()->get('refuse_refund_note');
  18. $oid = request()->get('order_id');
  19. $current_page = request()->get('current_page');
  20. $result = ImsCjdcOrderMain::where('id', $oid)->update([
  21. 'refuse_refund_note' => $note,
  22. 'state'=>10,
  23. 'updated_at' => time()
  24. ]);
  25. if ($result) {
  26. return $this->success('操作成功', "order?page={$current_page}");
  27. } else {
  28. return $this->error('操作失败');
  29. }
  30. }
  31. /**
  32. * Build a form here.
  33. */
  34. public function form()
  35. {
  36. $this->textarea('refuse_refund_note', '原因')->placeholder('请填写拒绝退款的理由,字数不得超过50个字')->required();
  37. $this->hidden('order_id')->value($this->data['order_id']);
  38. $this->hidden('current_page')->value($this->data['current_page']);
  39. }
  40. /**
  41. * The data of the form.
  42. *
  43. * @return array
  44. */
  45. public function default()
  46. {
  47. }
  48. }