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

57 lines
1.6 KiB

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