$this->userInfo['terminal'], 'user_id'=> $this->userId ]; $params = (new PlaceOrderValidate())->post()->goCheck('', $data); //订单结算信息 $settlement = OrderLogic::settlement($params); if (false === $settlement) { return $this->fail(OrderLogic::getError()); } //结算信息 if ($params['action'] == 'settle') { return $this->data($settlement); } //提交订单 $result = OrderLogic::submitOrder($settlement); if (false === $result) { return $this->fail(OrderLogic::getError(), []); } return $this->data($result); } /** * @notes 订单列表 * @return \think\response\Json * @author 段誉 * @date 2021/7/23 18:58 */ public function lists() { return $this->dataLists((new OrderLists())); } /** * @notes 订单详情 * @return \think\response\Json * @author 段誉 * @date 2021/8/2 21:00 */ public function detail() { $params = (new OrderValidate())->goCheck('detail', ['user_id' => $this->userId]); return $this->data(OrderLogic::getDetail($params)); } /** * @notes 取消订单 * @return \think\response\Json * @author 段誉 * @date 2021/8/2 16:37 */ public function cancel() { $params = (new OrderValidate())->post()->goCheck('cancel', ['user_id' => $this->userId]); $result = OrderLogic::cancelOrder($params); if (false === $result) { return $this->fail(OrderLogic::getError()); } return $this->success('取消订单成功'); } /** * @notes 确认收货 * @return \think\response\Json * @author 段誉 * @date 2021/8/2 15:21 */ public function confirm() { $params = (new OrderValidate())->post()->goCheck('confirm', ['user_id' => $this->userId]); OrderLogic::confirmOrder($params); return $this->success('确认收货成功'); } /** * @notes 查看物流 * @return \think\response\Json * @author ljj * @date 2021/8/13 6:08 下午 */ public function orderTraces() { $params = (new OrderValidate())->goCheck('OrderTraces', ['user_id' => $this->userId]); $result = OrderLogic::orderTraces($params); return $this->data($result); } /** * @notes 获取配送方式 * @return \think\response\Json * @author ljj * @date 2021/8/27 2:33 下午 */ public function getDeliveryType() { $result = (new OrderLogic())->getDeliveryType(); return $this->success('',$result); } /** * @notes 删除订单 * @return \think\response\Json * @author ljj * @date 2021/8/31 2:38 下午 */ public function del() { $params = (new OrderValidate())->post()->goCheck('del', ['user_id' => $this->userId]); (new OrderLogic())->del($params); return $this->success('删除成功',[],1,1); } /** * @notes 微信同步发货 查询 * @return \think\response\Json * @author lbzy * @datetime 2023-09-07 15:27:17 */ function wechatSyncCheck() { $id = $this->request->get('id'); $order = Order::where('id', $id)->where('user_id', $this->userId)->findOrEmpty(); $result = WechatMiniExpressSendSyncService::wechatSyncCheck($order); if (! $result) { return $this->fail('获取失败', [], 0, 0); } return $this->success('成功', $result); } /** * @notes 微信确认收货 获取详情 * @return \think\response\Json * @author lbzy * @datetime 2023-09-05 09:51:41 */ function wxReceiveDetail() { return $this->success('获取成功', OrderLogic::wxReceiveDetail(input('order_id/d'), $this->userId)); } }