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

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