From dd39b4d287292f433540016ad0e94f7a8ae05c3e Mon Sep 17 00:00:00 2001 From: liufumingren Date: Fri, 28 Aug 2026 19:55:57 +0800 Subject: [PATCH] =?UTF-8?q?api/Wms=20gzt=5Fbind=20=E5=A2=9E=E5=8A=A0=20err?= =?UTF-8?q?or=20=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Wms.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/application/api/controller/Wms.php b/application/api/controller/Wms.php index 376fb17..94461fd 100644 --- a/application/api/controller/Wms.php +++ b/application/api/controller/Wms.php @@ -317,15 +317,18 @@ class Wms extends Api } public function gzt_bind(){ $params=$this->request->post(); + \think\Log::error("[gzt_bind] 入参: " . json_encode($params, JSON_UNESCAPED_UNICODE)); $GztModel = new \app\common\model\wms\Gzt; $WAREHOUSEID = $this->auth->warehouseid; $gzt = $GztModel->where(['id'=>$params["id"],"wareHouseId"=>$WAREHOUSEID,"type"=>2])->find(); if(!$gzt){ + \think\Log::error("[gzt_bind] 工作台不存在或类型错误: id={$params['id']} wareHouseId={$WAREHOUSEID}"); $this->error("工作台不存在,或工作台是团购类型"); } $sid = $this->redis->get("bindcode_".$params["code"]); $sid2 = $this->redis->get("gzt_".$gzt["id"]); if(!$sid){ + \think\Log::error("[gzt_bind] 无记录或二维码已失效: code={$params['code']} gzt_id={$gzt['id']}"); $this->error('无记录或二维码已失效'); }else{ $uuid = Random::uuid(); @@ -341,6 +344,10 @@ class Wms extends Api $options = []; $urlEncodedString = http_build_query($requsetData); $req = Http::sendRequest($url, $urlEncodedString, 'POST', $options); + \think\Log::error("[gzt_bind] binded 请求结果: " . json_encode($req, JSON_UNESCAPED_UNICODE)); + if(!$req['ret']){ + \think\Log::error("[gzt_bind] binded 发送失败: " . json_encode($req, JSON_UNESCAPED_UNICODE)); + } if($sid2){ $requsetData = [ 'sid'=>$sid2, @@ -349,6 +356,10 @@ class Wms extends Api ]; $urlEncodedString = http_build_query($requsetData); $req = Http::sendRequest($url, $urlEncodedString, 'POST', $options); + \think\Log::error("[gzt_bind] cheakBind 请求结果: " . json_encode($req, JSON_UNESCAPED_UNICODE)); + if(!$req['ret']){ + \think\Log::error("[gzt_bind] cheakBind 发送失败: " . json_encode($req, JSON_UNESCAPED_UNICODE)); + } } $this->success('绑定成功'); }