diff --git a/application/index/controller/qiwe/Index.php b/application/index/controller/qiwe/Index.php index 23af098..e965841 100644 --- a/application/index/controller/qiwe/Index.php +++ b/application/index/controller/qiwe/Index.php @@ -942,7 +942,7 @@ class Index extends Frontend $result = $this->query->query("getRoomList", [$this->guid, $index]); $result = json_decode($result, true); - if ($result["code"] == 0) { + if ($result && $result["code"] == 0) { $data = $result["data"]; $roomList = $data["roomList"]; $insertDatas = []; @@ -992,7 +992,7 @@ class Index extends Frontend $result = json_decode($result, true); $insertDatas = []; - if ($result['code'] == 0) { + if ($result && $result['code'] == 0) { \think\Log::error('返回结果正常: '); $roomList = $result["data"]["roomList"]; @@ -1057,7 +1057,7 @@ class Index extends Frontend $result = json_decode($result, true); $insertDatas = []; - if ($result['code'] == 0) { + if ($result && $result['code'] == 0) { \think\Log::error('返回结果正常: '); $contactList = $result["data"]["contactList"]; \think\Log::error('返回结果正常: '.json_encode($contactList)); @@ -1161,7 +1161,7 @@ class Index extends Frontend //先通过URL上传文件获取fileId $result = $this->query->query("cdnBigUploadByUrl", [$this->guid, "照片.png",$imgUrl,1]); $result = json_decode($result, true); - if($result["code"] == 0){ + if($result && $result["code"] == 0){ $fileAesKey = $result["data"]["fileAesKey"]; $fileId = $result["data"]["fileId"]; $fileKey = $result["data"]["fileKey"]; @@ -1181,7 +1181,7 @@ class Index extends Frontend $filename = basename($fileUrl); $result = $this->query->query("cdnBigUploadByUrl", [$this->guid, $filename,$fileUrl,5]); $result = json_decode($result, true); - if($result["code"] == 0){ + if($result && $result["code"] == 0){ $fileAesKey = $result["data"]["fileAesKey"]; $fileId = $result["data"]["fileId"]; $fileKey = $result["data"]["fileKey"]; diff --git a/application/index/controller/wms/Chat.php b/application/index/controller/wms/Chat.php index 760c1d4..269cc58 100644 --- a/application/index/controller/wms/Chat.php +++ b/application/index/controller/wms/Chat.php @@ -1356,6 +1356,9 @@ _________________________________________________________ }else{ $count --; $msg = json_decode($msg,true); + if(!is_array($msg)){ + continue; + } $room = $RoomsModel->where(["STOREID"=>$msg["STOREID"],"auto_feedback_active"=>1])->find(); $Model = new \app\common\model\wms\Exceptionwmsorder; $Exceptionwmsorder_row = $Model->where(["POSTNUM"=>$msg["POSTNUM"]])->find(); @@ -1396,7 +1399,7 @@ _________________________________________________________ if($keyword){ array_push($wheres,'NAME like "%'.$keyword.'%"'); } - $where = implode($wheres," and "); + $where = implode(" and ", $wheres); $list = $this->RoomsModel->where($where)->limit(($page-1)*$pagesize,$pagesize)->order('id','desc')->select(); $count = $this->RoomsModel->where($where)->count(); return json(["rows"=>$list,"count"=>$count]); @@ -1413,7 +1416,7 @@ _________________________________________________________ if($keyword){ array_push($wheres,'NAME like "%'.$keyword.'%"'); } - $where = implode($wheres," and "); + $where = implode(" and ", $wheres); $list = $this->chatMethodsModel->where($where)->limit(($page-1)*$pagesize,$pagesize)->order('id','desc')->select(); $count = $this->chatMethodsModel->where($where)->count(); return json(["rows"=>$list,"count"=>$count]); @@ -1432,7 +1435,7 @@ _________________________________________________________ if($keyword){ array_push($wheres,'NAME like "%'.$keyword.'%"'); } - $where = implode($wheres," and "); + $where = implode(" and ", $wheres); $list = $this->RoomsModel->where($where)->limit(($page-1)*$pagesize,$pagesize)->select(); $count = $this->RoomsModel->where($where)->count(); return json(["rows"=>$list,"count"=>$count]); @@ -1593,7 +1596,7 @@ _________________________________________________________ if($keyword){ array_push($wheres,'TITLE like "%'.$keyword.'%"'); } - $where = implode($wheres," and "); + $where = implode(" and ", $wheres); $RoomsModel = $this->SOURCE == "wx" ? $this->RoomsModel : $this->qiweRoomsModel; $list = $this->StoreModel->where($where)->limit(($page-1)*$pagesize,$pagesize)->select(); $storeids = []; @@ -2910,7 +2913,7 @@ _________________________________________________________ foreach($postnums as $postnum){ try{ $order = $this->getOrderInfoByPostnum($postnum,$from); - if($order["ID"]){ + if($order && $order["ID"]){ $text = "{$postnum}\n"; $STOREID = $order["STOREID"]; $WAREHOUSEID = $order["WAREHOUSEID"]; diff --git a/application/index/library/chat/Orders.php b/application/index/library/chat/Orders.php index db0ed9a..4af5e33 100644 --- a/application/index/library/chat/Orders.php +++ b/application/index/library/chat/Orders.php @@ -427,11 +427,11 @@ class Orders $data = Wsdl::webservice([$order["warehouseid"],106300,$wmsorder->ID],'createPostNum'); $wmsorder = $orderModel->where(["SOURCEID"=>$order['ordercode']])->find(); - if(!$wmsorder["POSTNUM"]){ + if(empty($wmsorder["POSTNUM"])){ if($type==0){ - Wsdl::webservice([106300,$wmsorder["ID"]],"cancelOrderByIds"); + Wsdl::webservice([106300,($wmsorder["ID"] ?? null)],"cancelOrderByIds"); } - return [$type==0?2:4,"分配快递号失败,错误信息:\n".$wmsorder["ERRORRECORDS"],[]]; + return [$type==0?2:4,"分配快递号失败,错误信息:\n".($wmsorder["ERRORRECORDS"] ?? ''),[]]; }else{ if($type==1 && $order["postnum"]!=$wmsorder['POSTNUM']){ return [4,"新旧单号不一致,已通知快递拦截新单号,找吴菁处理,参数为(".json_encode($order_data).")",[]];