$this->userInfo['terminal'], 'user_id'=> $this->userId ]; $params = (new PlaceOrderValidate())->post()->goCheck('', $data); //订单结算信息 $settlement = (new OrderLogic())->settlement($params); if (false === $settlement) { return $this->fail(OrderLogic::getError()); } //结算信息 if ($params['action'] == 'settlement') { unset($settlement['city']); return $this->data($settlement); } //提交订单 $result = (new OrderLogic())->submitOrder($settlement); if (false === $result) { return $this->fail(OrderLogic::getError()); } return $this->data($result); } /** * @notes 获取技师服务时间 * @return \think\response\Json * @author cjhao * @date 2024/9/14 14:03 */ public function getCoachServerTime() { $coachId = $this->request->get('coach_id'); $goodsId = $this->request->get('goods_id'); $result = (new OrderLogic())->getCoachServerTime($coachId,$goodsId); if (false === $result) { return $this->fail(OrderLogic::getError()); } return $this->data($result); } /** * @notes 订单列表 * @return \think\response\Json * @author ljj * @date 2022/2/28 10:01 上午 */ public function lists() { return $this->dataLists(new OrderLists()); } /** * @notes 订单详情 * @return \think\response\Json * @author ljj * @date 2022/2/28 11:23 上午 */ public function detail() { $params = (new OrderValidate())->get()->goCheck('detail'); $result = (new OrderLogic())->detail($params['id']); return $this->success('',$result); } /** * @notes 取消订单 * @return \think\response\Json * @author ljj * @date 2022/2/28 11:36 上午 */ public function cancel() { $params = (new OrderValidate())->post()->goCheck('cancel'); $params['user_id'] = $this->userId; $result = (new OrderLogic())->cancel($params); if (true !== $result) { return $this->fail($result); } return $this->success('操作成功',[],1,1); } /** * @notes 删除订单 * @return \think\response\Json * @author ljj * @date 2022/2/28 11:50 上午 */ public function del() { $params = (new OrderValidate())->post()->goCheck('del'); (new OrderLogic())->del($params['id']); return $this->success('操作成功',[],1,1); } /** * @notes 支付方式 * @return \think\response\Json * @author ljj * @date 2024/7/24 下午7:08 */ public function payWay() { $params = (new OrderValidate())->get()->goCheck('payWay',['user_id'=>$this->userId]); $result = OrderLogic::payWay($params); if(false === $result){ return $this->fail(OrderLogic::getError()); } return $this->data($result); } /** * @notes 订单补差价 * @return \think\response\Json * @author cjhao * @date 2024/9/18 12:34 */ public function orderGap() { $params = (new OrderGapValidate())->post()->goCheck('',['user_id'=>$this->userId]); $result = (new OrderLogic())->orderGap($params); if (false === $result) { return $this->fail(OrderLogic::getError()); } return $this->data($result); } /** * @notes 订单加钟 * @return \think\response\Json * @author cjhao * @date 2024/9/18 13:45 */ public function orderAppend() { $params = (new OrderAppendValidate())->post()->goCheck('',['user_id'=>$this->userId]); $result = (new OrderLogic())->orderAppend($params); if (false === $result) { return $this->fail(OrderLogic::getError()); } return $this->data($result); } /** * @notes 订单评论 * @return \think\response\Json * @author cjhao * @date 2024/9/24 20:43 */ public function comment() { $params = (new OrderCommentValidate())->post()->goCheck('',['user_id'=>$this->userId]); $result = (new OrderLogic())->comment($params); if (false === $result) { return $this->fail(OrderLogic::getError()); } return $this->success('评论成功',[],1,1,); } public function test(){ // 存储引擎 $config = [ 'default' => ConfigService::get('storage', 'default', 'local'), 'engine' => ConfigService::get('storage') ]; // 第三方存储 $avatar = 'uploads/user/avatar/' . md5(22 . time()) . '.jpeg'; $headimgurl = 'https://thirdwx.qlogo.cn/mmopen/vi_32/PiajxSqBRaEK0ymicw4pcTUx7ZZaQrsnK46O8atVibKY4WbcBpaic9rUapwlul4fJXx87EgkYQwypzYNnAib3evXM9hU8a54IMtE02OXNeAxxDCXmmGKUmwbCbw/132'; $StorageDriver = new StorageDriver($config); dd($StorageDriver->fetch($headimgurl, $avatar)); if (!$StorageDriver->fetch($headimgurl, $avatar)) { throw new Exception('头像保存失败:' . $StorageDriver->getError()); } dd(123); } }