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

55 lines
1.1 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <?php
  2. namespace App\Admin\Forms;
  3. use App\Models\ImsCjdcOrderMain;
  4. use App\Models\LanzuServiceHorseman;
  5. use Dcat\Admin\Widgets\Form;
  6. use Symfony\Component\HttpFoundation\Response;
  7. class SelectHorseman extends Form
  8. {
  9. /**
  10. * Handle the form request.
  11. *
  12. * @param array $input
  13. *
  14. * @return Response
  15. */
  16. protected $orderId;
  17. public function handle(array $input)
  18. {
  19. $hid = request()->get('horseman_id');
  20. $oid = request()->get('order_id');
  21. $result = ImsCjdcOrderMain::where('id',$oid)->update(['shipping_type'=>1,'horseman_id'=>$hid]);
  22. if ($result){
  23. return $this->success('操作成功', '/order');
  24. }else{
  25. return $this->error('操作失败');
  26. }
  27. }
  28. /**
  29. * Build a form here.
  30. */
  31. public function form()
  32. {
  33. $this->select('horseman_id','配送员')
  34. ->options(LanzuServiceHorseman::getHorseman())
  35. ->required();
  36. $this->hidden('order_id')->value($this->data['order_id']);
  37. }
  38. /**
  39. * The data of the form.
  40. *
  41. * @return array
  42. */
  43. public function default()
  44. {
  45. }
  46. }