Order.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace app\admin\controller;
  3. use app\admin\logic\OrderLogic;
  4. use app\BaseController;
  5. use think\exception\ValidateException;
  6. use think\facade\Config;
  7. use think\facade\Validate;
  8. class Order extends BaseController
  9. {
  10. //列表
  11. public function list()
  12. {
  13. $param = $this->request->only(['page' => 1, 'size' => 10, 'masterOrderCode' => '', 'orderCode' => '', 'status' => '', 'name' => '', 'username' => '', 'start_date' => '', 'end_date' => '', 'type' => ''], 'post');
  14. return OrderLogic::list($param);
  15. }
  16. //详情
  17. public function read()
  18. {
  19. $id = $this->request->post('id/d', 0);
  20. return OrderLogic::read($id);
  21. }
  22. //导出
  23. public function export()
  24. {
  25. $param = $this->request->only(['masterOrderCode' => '', 'orderCode' => '', 'status' => '', 'name' => '', 'username' => '', 'start_date' => '', 'end_date' => '', 'type' => '', 'token' => ''], 'post');
  26. return OrderLogic::export($param);
  27. }
  28. //发货
  29. public function deliver()
  30. {
  31. $list = $this->request->post('list/a', 'post');
  32. $val = Validate::rule(['list|发货列表' => 'require|array|length:1,100']);
  33. if (!$val->check(['list' => $list])) throw new ValidateException($val->getError());
  34. return OrderLogic::deliver($list);
  35. }
  36. }