链街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.3 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
  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. $current_page = request()->get('current_page');
  22. $result = ImsCjdcOrderMain::where('id',$oid)->update(['shipping_type'=>1,'horseman_id'=>$hid,'updated_at'=>time()]);
  23. if ($result){
  24. return $this->success('操作成功',"order?page={$current_page}");
  25. }else{
  26. return $this->error('操作失败');
  27. }
  28. }
  29. /**
  30. * Build a form here.
  31. */
  32. public function form()
  33. {
  34. $this->select('horseman_id','配送员')
  35. ->options(LanzuServiceHorseman::getHorseman())
  36. ->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. }