OrderExchange.php 1.2 KB

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