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

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