shop; $shopName = $shop->shopName ?? ''; $sjName = $shop->merchantName ?? ''; $name = $shopName == '首店' ? $sjName : $sjName . ' ' . $shopName; $adminId = $this->adminId; util::checkRepeatCommit($adminId, 4); $storeData = [ 'out_store_id' => $this->mainId, //自定义门店编号 -- 从 shopId 改为 dmainId 'store_name' => $name, 'address_info' => [ 'province' => $shop->province, 'city' => $shop->city, 'area' => $shop->dist, 'street' => '', 'house' => $shop->floor ? $shop->address . $shop->floor : $shop->address, 'lat' => $shop->lat, 'lng' => $shop->long, 'phone' => $shop->telephone ] ]; // 验证必填参数 $requiredFields = ['out_store_id', 'store_name', 'address_info']; foreach ($requiredFields as $field) { if (empty($storeData[$field])) { util::fail("缺少必填参数:{$field}"); } } // 创建门店前,检查是否已经 开通门店权限 (有wxStoreId,即说明开通了) //$shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true, false, 'id, wxStoreId'); $shopExt = MainClass::getById($this->mainId, true, 'id, wxStoreId'); // 查询是否存在 wx_store_id,不存在则执行apply if ($shopExt->wxStoreId == '') { $re = IntraCityExpress::applyStore(); if (!is_array($re)) { $re = Json::decode($re, true); } if ($re['errcode'] != 0) { Yii::error("开通门店权限失败:" . $re['errmsg']); util::fail('开通门店权限失败'); } } $result = IntraCityExpress::createStore($storeData); if ($result['errcode'] === 0) { // 保存微信门店编号(wx_store_id) $shopExt->wxStoreId = $result['wx_store_id']; $shopExt->save(); util::success($result, "门店创建成功"); } else { Yii::error("门店创建失败:" . $result['errmsg']); util::fail($result['errmsg']); } } catch (\Exception $e) { Yii::error("门店创建失败:" . $e->getMessage()); util::fail("系统出错"); } } /** * 查询门店创建情况 */ public function actionStore() { $shopId = $this->shopId; // 首先从门店扩展表查询是否已经创建 //$shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true, false, 'id, wxStoreId'); $shopExt = MainClass::getById($this->mainId, true, 'id, wxStoreId'); if ($shopExt->wxStoreId == '') { // 不存在,则从微信接口查询 $result = IntraCityExpress::getStore($this->mainId); if ($result['errcode'] === 0) { $store = $result['store_list'][0]; // 保存 wx_store_id $shopExt->wxStoreId = $store['wx_store_id']; $shopExt->save(); util::success($store, "门店查询成功"); } else { Yii::error("门店查询失败:" . $result['errmsg']); util::fail('门店查询失败'); } } else { $field = 'province, city, dist, lat, long, floor, address'; $shop = ShopClass::getById($shopId, false, $field); $data = array_merge($shop, $shopExt->toArray()); util::success($data, "门店查询成功"); } } /** * 更新门店 */ public function actionUpdateStore() { // 首先从门店扩展表查询是否已经创建 //$shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], false, false, 'id, wxStoreId'); $shopExt = MainClass::getById($this->mainId, false, 'id, wxStoreId'); if ($shopExt['wxStoreId'] == '') { util::fail('未创建门店,请先创建'); } $adminId = $this->adminId; util::checkRepeatCommit($adminId, 4); $shop = $this->shop; $shopName = $shop->shopName ?? ''; $sjName = $shop->merchantName ?? ''; $name = $shopName == '首店' ? $sjName : $sjName . ' ' . $shopName; $storeData = [ 'keys' => ['wx_store_id' => $shopExt['wxStoreId']], 'content' => [ 'store_name' => $name, 'address_info' => [ 'province' => $shop->province, 'city' => $shop->city, 'area' => $shop->dist, 'street' => '', 'house' => $shop->floor ? $shop->address . $shop->floor : $shop->address, 'lat' => $shop->lat, 'lng' => $shop->long, 'phone' => $shop->telephone ], //"order_pattern" => 2, //"service_trans_prefer" => "SFTC" //order_pattern = 2时必填 ] ]; $result = IntraCityExpress::updateStore($storeData); if ($result['errcode'] === 0) { util::success($result, "门店更新成功"); } else { Yii::error("门店更新失败:" . $result['errmsg']); util::fail($result['errmsg']); //util::fail('门店更新失败'); } } /** * 门店运费充值 */ public function actionStoreCharge() { $post = Yii::$app->request->post(); $amount = floatval($post['amount']); $amountTurnFen = $amount * 100; if ($amountTurnFen < 5000) { util::fail('50元起充'); } $expressId = $post['expressId']; $serviceTransIds = ['SFTC', 'DADA']; if (!in_array($expressId, $serviceTransIds)) { util::fail('快递动力ID出错'); } //$shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], false, false, 'id, wxStoreId'); $shopExt = MainClass::getById($this->mainId, false, 'id, wxStoreId'); if ($shopExt['wxStoreId'] == '') { util::fail('微信门店编号为空'); } $wxStoreId = $shopExt['wxStoreId']; $result = IntraCityExpress::storeCharge($wxStoreId, $expressId, $amountTurnFen); if ($result['errcode'] === 0) { util::success($result, "门店余额充值单已生成"); } else { Yii::error("门店余额充值失败:" . $result['errmsg']); util::fail('门店余额充值失败'); } } /** * 门店余额查询 */ public function actionStoreBalance() { //$shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], false, false, 'id, wxStoreId'); $shopExt = MainClass::getById($this->mainId, false, 'id, wxStoreId'); if ($shopExt['wxStoreId'] == '') { util::fail('微信门店编号为空'); } $wxStoreId = $shopExt['wxStoreId']; $result = IntraCityExpress::getBalance($wxStoreId); if ($result['errcode'] === 0) { $data = ['all_balance' => $result['all_balance'] / 100.0]; foreach ($result['balance_detail'] as $item) { if ($item['service_trans_id'] == 'DADA') { $data['dada_balance'] = $item['balance'] / 100.0; } if ($item['service_trans_id'] == 'SFTC') { $data['sf_balance'] = $item['balance'] / 100.0; } } util::success($data, "门店余额查询成功"); } else { Yii::error("门店余额查询失败:" . $result['errmsg']); util::fail('门店余额查询失败'); } } /** * 查询运费 */ public function actionStoreFee() { $post = Yii::$app->request->post(); // 创建表单验证模型 $form = new StoreFeeForm(); $form->setScenario('store_fee'); $form->load($post, ''); // 直接从 post 数据加载,不使用模型名作为前缀 // 执行表单验证 $form->validateForm(); $orderId = $post['orderId']; $order = OrderClass::getById($orderId); if (empty($order)) { util::fail('订单出错'); } if ($order['mainId'] != $this->mainId) { util::fail('不是你的订单哈。'); } $shopId = intval($this->shopId); if (empty($shopId)) { util::fail("门店不存在"); } $weight = $post['weight'] ?? 0; $price = $post['price'] ?? 0; $packageNum = $post['packageNum'] ?? 0; $main = $this->main; $wxStoreId = $main->wxStoreId ?? ''; if (empty($wxStoreId)) { util::fail('你还没有开通跑腿'); } $cargoName = '花材'; // 商品名称,默认是花材 $cargo = [ 'cargo_name' => $cargoName, // 商品名称 -- $order 中没有,要在 goodsInfo 中取 'cargo_weight' => intval($weight * 1000), // 单位:克 -- 把千克转换为克 'cargo_price' => intval($price * 100), // 单位:分 -- 把元转换为分 'cargo_type' => IntraCityExpress::GOODS_TYPE_FLOWER, 'cargo_num' => intval($packageNum) ]; $originalLng = doubleval($post['user_lng']); $originalLat = doubleval($post['user_lat']); $useSandBox = getenv('YII_ENV') == 'production' ? 0 : 1;// 根据环境变量判断是否使用沙盒环境 $orderData = [ //'out_store_id' => $shopId, 'wx_store_id' => $wxStoreId, 'user_name' => $post['user_name'], 'user_phone' => $post['user_phone'], 'user_lng' => $originalLng, 'user_lat' => $originalLat, 'user_address' => $post['user_address'], 'cargo' => $cargo, 'use_sandbox' => $useSandBox, ]; //多处有用到这个方法,需修改请同步修改,搜索关键词 intra_city_express_pre_add $result = IntraCityExpress::preAddOrder($orderData); if ($result['errcode'] === 0) { util::success($result, "查询成功"); } else { $errMsg = $result['errmsg'] ?? ''; Yii::error("运费查询失败:" . $errMsg); util::fail('查询失败'); } } /** * 创建订单 * POST /intra-city/create-order */ public function actionCreateOrder() { $post = Yii::$app->request->post(); $adminId = $this->adminId; util::checkRepeatCommit($adminId, 4); $orderId = intval($post['orderId']); $field = 'mainId, status, sendStatus, repeat, forward, orderSn, userId, actPrice, sendNum, salt'; $order = OrderClass::getById($orderId, false, $field); if (empty($order)) { util::fail('没有找到订单'); } if ($order['mainId'] != $this->mainId) { util::fail('不是你的订单'); } // 不能创建配送的几种订单状态 if ($order['status'] != 2) { util::fail('待发货订单才能发跑腿,请刷新页面'); } // 不能创建配送的几种配送状态 $notCanCreateSendStatus = [-1, 3]; if (!in_array($order['sendStatus'], $notCanCreateSendStatus)) { util::fail('不能叫跑腿,请刷新页面'); } if ($order['repeat'] == 1) { util::fail('收款码订单不支持跑腿'); } if ($order['forward'] == 1) { util::fail('售后付款单不支持跑腿'); } $packageNum = $post['packageNum'] ?? 0; if ($packageNum <= 0) { util::fail('请填写包裹数量'); } $sn = $order['orderSn']; $salt = $order['salt'] ?? ""; $orderType = $order['orderType'] ?? 1; $goodsNum = $order['goodsNum'] ?? 0; $goodsNum = $goodsNum > 0 ? $goodsNum : 1; $itemList = [['item_name' => '花材', 'item_pic_url' => imgUtil::groupImg(''), 'count' => $goodsNum]]; if ($orderType == 1) { $itemInfo = OrderGoodsClass::getByCondition(['orderSn' => $sn], true); if (!empty($itemInfo)) { $cover = $itemInfo['cover'] ?? ''; $itemList = [['item_name' => '花束', 'item_pic_url' => imgUtil::groupImg($cover), 'count' => $goodsNum]]; } } else { $itemInfo = OrderItemClass::getByCondition(['orderSn' => $sn], true); if (!empty($itemInfo)) { $cover = $itemInfo['cover'] ?? ''; $itemList = [['item_name' => '花材', 'item_pic_url' => imgUtil::groupImg($cover), 'count' => $goodsNum]]; } } $cargoName = $orderType == 1 ? '花束' : '花材'; $main = $this->main; $wxStoreId = $main->wxStoreId ?? ''; if (empty($wxStoreId)) { util::fail('你还没有开通跑腿'); } // 通过 userId 获取 openid(小程序OpenId) $user = UserClass::getById($order['userId'], false, 'id, miniOpenId'); if (empty($user)) { util::fail('用户信息缺失'); } $miniOpenId = $user['miniOpenId'] ?? ''; if (empty($miniOpenId)) { $admin = $this->admin; $miniOpenId = $admin->miniOpenId ?? ''; } if (empty($miniOpenId)) { util::fail('没有找到用户的微信数据'); } $cargo = [ 'cargo_name' => $cargoName, 'cargo_weight' => intval($post['weight'] * 1000), 'cargo_type' => IntraCityExpress::GOODS_TYPE_FLOWER, 'cargo_num' => intval($packageNum), 'cargo_price' => intval($order['actPrice'] * 100), // $order 中有各个价格,请注意 'item_list' => $itemList, ]; $shopId = $this->shopId; $mainId = $this->mainId; $snData = ['shopId' => $shopId, 'mainId' => $mainId]; $storeOrderId = orderSn::getExpressSn($snData); $callbackUrl = Yii::$app->params['hdHost'] . '/intra-city/callback'; $orderData = [ 'wx_store_id' => $wxStoreId, 'store_order_id' => $storeOrderId, //同一个门店订单编号要保证唯一,相同的订单号会重入 'user_openid' => $miniOpenId, 'user_lng' => $post['user_lng'], 'user_lat' => $post['user_lat'], 'user_address' => $post['user_address'], 'user_name' => $post['user_name'], 'user_phone' => $post['user_phone'], 'order_seq' => $order['sendNum'], // 用于配送员快速寻找到匹配的商品(非必传) -- 对应 xhOrder 表的 sendNum 'verify_code_type' => 0, 'order_detail_path' => '/admin/order/info?id=' . $orderId . '&salt=' . $salt, 'callback_url' => $callbackUrl, // 订单状态回调地址(非必传) 'use_sandbox' => 0, 'cargo' => $cargo ]; $result = IntraCityExpress::createOrder($orderData); if (isset($result['errcode']) && $result['errcode'] === 0) { $deliveryId = $result['service_trans_id'] ?? ''; // 更新订单状态为配送中,已呼叫小哥,等小哥接单;有可能到店自取的转跑腿,sendType要变化 OrderClass::updateById($orderId, ['sendStatus' => 0, 'status' => 3, 'deliveryId' => $deliveryId, 'sendType' => 2]); // 保存进 xhExpressOrder 表 $orderData = [ 'mainId' => $this->mainId, 'shopId' => $this->shopId, 'deliveryId' => $deliveryId, 'wxOrderId' => $result['wx_order_id'] ?? '', 'wxStoreId' => $result['wx_store_id'] ?? '', 'storeOrderId' => $result['store_order_id'] ?? '', 'orderId' => $orderId, 'transOrderId' => $result['trans_order_id'] ?? '', 'distance' => $result['distance'] ?? 0, 'fee' => $result['fee'] ?? 0, 'fetchCode' => $result['fetch_code'] ?? '', 'orderSeq' => $result['order_seq'] ?? '' ]; ExpressOrderClass::add($orderData); util::success(['fee' => $result['fee']], '订单创建成功'); } else { noticeUtil::push("门店 -- " . $this->mainId . ",订单创建失败:" . json_encode($result)); Yii::error("订单创建失败:" . ($result['errmsg'] ?? '未知错误'), 'intracity'); $errorMsg = $result['errmsg'] ?? ''; noticeUtil::push("跑腿单创建失败:" . $errorMsg, '15280215347'); util::fail('提交失败,请确认余额是否充足'); } } /** * 查询订单 * GET /intra-city/get-order */ public function actionGetOrder() { try { //$shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], false, false, 'id, wxStoreId'); $shopExt = MainClass::getById($this->mainId, false, 'id, wxStoreId'); if (empty($shopExt)) { util::fail("微信门店不存在"); } $post = Yii::$app->request->post(); $wxOrderId = isset($post['wx_order_id']) ? $post['wx_order_id'] : ''; $orderId = $post['orderId']; //$wxStoreId = isset($post['wx_store_id']) ? $post['wx_order_id'] : $shopExt['wxStoreId']; $wxStoreId = isset($post['wx_store_id']) ? $post['wx_store_id'] : $shopExt['wxStoreId']; if (empty($wxOrderId) && (empty($orderId) || empty($wxStoreId))) { util::fail("参数不足:wx_order_id 或 (order_id + wx_store_id) 必须提供一组"); } $order = OrderClass::getById($orderId, false, 'id, mainId, sendStatus'); if ($order['mainId'] != $this->mainId) { util::fail('不是你的订单!'); } // 检查是否存在重复的订单:如果存在,则使用最后一个订单的 store_order_id $storeOrderId = $orderId; // ------------------------------------- 注意区分:$storeOrderId , $orderId 。它们有可能不相同 $query = (new Query()) ->from('xhExpressOrder') ->where(['orderId' => $orderId]) ->andWhere(['status' => 1]) ->orderBy('addTime DESC'); $esDatas = $query->all(); $count = count($esDatas); if ($count > 0) { $es = $esDatas[0]; $storeOrderId = $es['storeOrderId']; if ($count > 1) { noticeUtil::push('同城配送订单重复多于1个. store_order_id:' . $orderId . ',wx_store_id:' . $wxStoreId); } } $result = IntraCityExpress::queryOrder($wxStoreId, $storeOrderId, $wxOrderId); if (isset($result['errcode']) && $result['errcode'] === 0) { util::success($result, "查询成功"); } else { Yii::error("订单查询失败:" . ($result['errmsg'] ?? '未知错误'), 'intracity'); util::fail('订单查询失败: ' . $result['errcode']); } } catch (\Exception $e) { Yii::error("订单查询异常:" . $e->getMessage(), 'intracity'); util::fail("系统出错"); } } /** * 取消订单 * POST /intra-city/cancel-order */ public function actionCancelOrder() { $post = Yii::$app->request->post(); $adminId = $this->adminId; util::checkRepeatCommit($adminId, 4); $orderId = $post['orderId']; $order = OrderClass::getById($orderId, true, 'id, mainId, sendStatus,status'); if (empty($order)) { util::fail('没有找到订单'); } if ($order->mainId != $this->mainId) { util::fail('不是你的订单'); } $main = $this->main; $wxStoreId = $main->wxStoreId ?? ''; if ($order->status != 3) { util::fail('不能取消'); } if (in_array($order->sendStatus, [-1, 2, 3])) { //订单 没叫跑腿、已送达、已取消 util::fail('不能取消哈'); } $express = ExpressOrderClass::getByCondition(['orderId' => $orderId, 'status' => 1], true); if (empty($express)) { util::fail('没有找到有效配送单'); } $wxOrderId = $express->wxOrderId ?? ''; $storeOrderId = $express->storeOrderId ?? ''; $result = IntraCityExpress::cancelOrder($wxOrderId, $storeOrderId, $wxStoreId); if (isset($result['errcode']) && $result['errcode'] === 0) { // 更新订单状态 $order->sendStatus = 3; $order->status = 2; $order->save(); $deductFee = $result['deductfee'] ?? 0; $express->status = 0; $express->cancelTime = date('Y-m-d H:i:s'); $express->deductfee = $deductFee; $express->save(); util::success($result, "取消成功"); } else { util::fail('取消失败'); } } /** * 获取订单列表 * GET /intra-city/order-list */ public function actionOrderList() { } /** * 微信回调接口 * POST /intra-city/callback */ public function actionCallback() { $callbackData = Yii::$app->request->post(); if (empty($callbackData)) { $postStr = file_get_contents('php://input'); // 处理转义字符,将JSON字符串正确解析为数组 $postStr = stripslashes($postStr); $callbackData = json_decode($postStr, true); if (empty($callbackData)) { util::fail('回调请求的数据为空'); } } // 从配置中获取安全token // $token = Yii::$app->params['wx_intracity_token'] ?? 'your_token_here'; // $result = IntraCityExpress::handleOrderCallback($callbackData, $token); // 记录回调日志 Yii::info('同城配送回调:' . json_encode($callbackData, JSON_UNESCAPED_UNICODE)); $storeOrderId = $callbackData['store_order_id'] ?? 0; $wxStoreId = $callbackData['wx_store_id'] ?? ''; //微信门店编号 if (empty($storeOrderId) || empty($wxStoreId)) { return $this->asJson(['return_code' => 1, 'return_msg' => '请求参数不正确']); } try { // 使用 storeOrderId 与 wxStoreId 去查询 xhExpressOrder 表 $eo = ExpressOrderClass::getByCondition(['storeOrderId' => $storeOrderId, 'wxStoreId' => $wxStoreId], true, false); if (empty($eo)) { Yii::error('订单不存在.store_order_id: ' . $storeOrderId . ',wx_store_id: ' . $wxStoreId); return $this->asJson(['return_code' => 1, 'return_msg' => '系统错误']); } $orderId = $eo->orderId ?? 0; if (empty($orderId)) { $errRemind = '订单号为空,store_order_id: ' . $storeOrderId . ',wx_store_id: ' . $wxStoreId; Yii::error($errRemind, 'intracity'); noticeUtil::push($errRemind, '15280215347'); return $this->asJson(['return_code' => 1, 'return_msg' => '系统错误2']); } $order = OrderClass::getById($orderId, true, 'id,mainId,status,sendStatus'); if (empty($order)) { $errRemind = '没有找到订单,store_order_id: ' . $storeOrderId . ',wx_store_id: ' . $wxStoreId; Yii::error($errRemind, 'intracity'); noticeUtil::push($errRemind, '15280215347'); return $this->asJson(['return_code' => 1, 'return_msg' => '系统错误3']); } $orderStatus = intval($callbackData['order_status']); //同个配送单,同个状态的,5秒内不允许重复请求,重要勿删 $uniqueId = $storeOrderId . '_' . $orderStatus; util::checkRepeatCommit($uniqueId, 5); $tx = Yii::$app->db->beginTransaction(); // ====================== 开启事务 $msg = ''; // 发通知的内容(默认为空,根据情况生成。没有内容则不会发通知) switch ($orderStatus) { // 订单创建成功,已叫跑腿,等跑腿接单 case IntraCityExpress::ORDER_STATUS_CREATED: if ($order->status == 2) { $eo->orderStatus = 1; $eo->save(); $order->status = 3; $order->sendStatus = 0; $order->save(); } break; // 配送员接单 case IntraCityExpress::ORDER_STATUS_ACCEPTED: if ($order->status == 3) { $eo->orderStatus = 4; $eo->save(); $order->sendStatus = 1; $order->save(); } break; // 配送员到店 case IntraCityExpress::ORDER_STATUS_ARRIVED: if ($order->status == 3) { $eo->orderStatus = 5; $eo->save(); $order->sendStatus = 4; $order->save(); } break; // 配送中 case IntraCityExpress::ORDER_STATUS_DELIVERING: if ($order->status == 3) { $eo->orderStatus = 6; $eo->save(); $order->sendStatus = 5; $order->save(); } break; // 配送完成 case IntraCityExpress::ORDER_STATUS_COMPLETED: if ($order->status == 3) { $eo->orderStatus = 8; $eo->save(); $order->status = 4;//配送完成 $order->sendStatus = 2;//配送完成 $order->save(); } break; // 商家取消订单 case IntraCityExpress::ORDER_STATUS_CANCELED_BY_MERCHANT: if ($order->status == 3) { $eo->orderStatus = 2; $eo->save(); $order->status = 2;//取消配送 $order->sendStatus = 3;//取消配送 $order->save(); } $msg = '取消配送,订单编号 '; break; // 配送员撤单 case IntraCityExpress::ORDER_STATUS_WITHDRAWN: //todo 配送员撤单,目前我们认为会重新派单,先不要有任何操作!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! $msg = '跑腿取消配送,订单编号 '; break; // 配送方取消订单 case IntraCityExpress::ORDER_STATUS_CANCELED_BY_DELIVERY: if ($order->status == 3) { $eo->orderStatus = 3; $eo->status = 0; $eo->save(); $order->status = 2;//取消配送 $order->sendStatus = 3;//取消配送 $order->save(); } $msg = '配送方取消配送,订单编号 '; break; // 配送异常 case IntraCityExpress::ORDER_STATUS_EXCEPTION: if ($order->status == 3) { $eo->orderStatus = 9; $eo->status = 0; $eo->save(); $order->status = 2;//取消配送 $order->sendStatus = 3;//取消配送 $order->save(); } $msg = '订单配送异常,订单编号 '; break; } if (empty($msg)) { // $msg 不为空,则发通知 $order = OrderClass::getById($orderId, true, 'id, shopId, customName, sendNum'); $shop = ShopClass::getById($order->shopId, true, 'id, ptStyle, mainId'); $result = $msg . $order->sendNum; WxMessageClass::expressErrorInform($shop, $order->customName, $orderId, $result); } $tx->commit(); // ====================== 事务提交 return $this->asJson(['return_code' => 0, 'return_msg' => 'OK']); // 成功状态的返回数据 } catch (\Exception $e) { Yii::error('同城配送回调处理异常:' . $e->getMessage()); return $this->asJson(['return_code' => 1, 'return_msg' => '系统错误']); } } //模拟接口回调 ssh 20250826 public function actionMockNotify() { if (getenv('YII_ENV') != 'production') { $post = Yii::$app->request->post(); $orderStatus = $post['orderStatus'] ?? 0; $wxOrderId = $post['wxOrderId'] ?? ''; $ptStyle = dict::getDict('ptStyle', 'hd'); $merchant = WxOpenClass::getWxInfo(); $ret = IntraCityExpress::mockNotify($orderStatus, $wxOrderId, '', '', $merchant, $ptStyle); util::success($ret); } util::complete(); } }