Localorder.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * Niushop商城系统 - 团队十年电商经验汇集巨献!
  4. * =========================================================
  5. * Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
  6. * ----------------------------------------------
  7. * 官方网址: https://www.niushop.com
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
  9. * 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
  10. * =========================================================
  11. */
  12. namespace app\shopapi\controller;
  13. use app\model\order\LocalOrder as LocalOrderModel;
  14. /**
  15. * 外卖订单
  16. * Class Order
  17. * @package app\shop\controller
  18. */
  19. class Localorder extends BaseApi
  20. {
  21. public function __construct()
  22. {
  23. //执行父类构造函数
  24. parent::__construct();
  25. $token = $this->checkToken();
  26. if ($token[ 'code' ] < 0) {
  27. echo $this->response($token);
  28. exit;
  29. }
  30. }
  31. /**
  32. * 发货
  33. * @return false|string
  34. */
  35. public function delivery()
  36. {
  37. $order_id = isset($this->params[ 'order_id' ]) ? $this->params[ 'order_id' ] : 0;
  38. $deliverer = isset($this->params[ 'deliverer' ]) ? $this->params[ 'deliverer' ] : '';
  39. $deliverer_mobile = isset($this->params[ 'deliverer_mobile' ]) ? $this->params[ 'deliverer_mobile' ] : '';
  40. $local_order_model = new LocalOrderModel();
  41. $data = [
  42. 'order_id' => $order_id,
  43. 'deliverer' => $deliverer,
  44. 'deliverer_mobile' => $deliverer_mobile,
  45. 'site_id' => $this->site_id
  46. ];
  47. $result = $local_order_model->orderGoodsDelivery($data);
  48. return $this->response($result);
  49. }
  50. }