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

59 lines
1.1 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
  1. <?php
  2. namespace App\Admin\Extensions;
  3. use App\Models\ImsCjdcOrderMain;
  4. use App\Models\StoreAccount;
  5. use Dcat\Admin\Grid\RowAction;
  6. use Illuminate\Http\Request;
  7. class CheckRow extends RowAction
  8. {
  9. protected $model;
  10. protected $state;
  11. protected $title;
  12. public function __construct($title=null,$state=null)
  13. {
  14. parent::__construct($title);
  15. $this->state = $state;
  16. }
  17. /**
  18. * 处理请求
  19. *
  20. * @param Request $request
  21. *
  22. * @return \Dcat\Admin\Actions\Response
  23. */
  24. public function handle(Request $request)
  25. {
  26. // 获取当前行ID
  27. $id = $this->getKey();
  28. $orderMain = new ImsCjdcOrderMain();
  29. $state = $request->get('state');
  30. $res = $orderMain->modifyState($id,$state);
  31. if ($res==true){
  32. return $this->response()->success('操作成功')->refresh();
  33. }else{
  34. return $this->response()->error('操作失败');
  35. }
  36. }
  37. /**
  38. * 设置要POST到接口的数据
  39. *
  40. * @return array
  41. */
  42. public function parameters()
  43. {
  44. return [
  45. 'state' => $this->state,
  46. ];
  47. }
  48. }