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

76 lines
1.6 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. <?php
  2. namespace App\Admin\Extensions;
  3. use App\Models\ImsCjdcOrderMain;
  4. use Dcat\Admin\Grid\Displayers\Modal;
  5. use Dcat\Admin\Grid\RowAction;
  6. use Dcat\Admin\Layout\Content;
  7. use Illuminate\Http\Request;
  8. class OrderStateHandle extends RowAction
  9. {
  10. protected $model;
  11. protected $state;
  12. protected $title;
  13. protected $content;
  14. public function __construct($title=null,$state=null)
  15. {
  16. parent::__construct($title);
  17. $this->state = $state;
  18. }
  19. /**
  20. * 处理请求
  21. *
  22. * @param Request $request
  23. *
  24. * @return \Dcat\Admin\Actions\Response
  25. */
  26. public function handle(Request $request)
  27. {
  28. // 获取当前行ID
  29. $id = $this->getKey();
  30. $orderMain = new ImsCjdcOrderMain();
  31. $state = $request->get('state');
  32. if ($state==30){
  33. $content = new Content();
  34. $content = $this->showForm($content);
  35. return $content;
  36. dd('弹出表单');
  37. //$res = $orderMain->updateShippingType($id,1);
  38. }elseif ($state==100){
  39. }else{
  40. $res = $orderMain->modifyState($id,$state);
  41. }
  42. if ($res==true){
  43. return $this->response()->success('操作成功')->refresh();
  44. }else{
  45. return $this->response()->error('操作失败');
  46. }
  47. }
  48. /**
  49. * 设置要POST到接口的数据
  50. *
  51. * @return array
  52. */
  53. public function parameters()
  54. {
  55. return [
  56. 'state' => $this->state,
  57. ];
  58. }
  59. public function showForm(Content $content)
  60. {
  61. return $content->title('站内自送')->body("<h1>hello world!</h1>");
  62. }
  63. }