$params, 'response' => $responseData ], 'JiuZhouOrderList'); if(isset($responseData['code']) && $responseData['code'] != 0) { EmailQueue::rPush('获取九州平台下的订单信息返回错误', $responseData['message'], ['song.shen@kuxuan-inc.com'], '猎羽'); Log::logError('获取九州平台下的订单信息返回错误', ['response' => $responseData], 'JiuZhouApi'); return [[], 0]; } $data = $responseData['list'] ?? []; $count= $responseData['total_num'] ?? 0; return [$data, $count]; } public static function getMsgTypeByCorpid($corpid) { foreach(self::$sysGroupIdList as $sysGroupId) { $corpList = RedisModel::get('Playlet::userCorpList-' . $sysGroupId); $corpList = !empty($corpList) ? json_decode($corpList, 1) : []; if(in_array($corpid, $corpList)) { if (2 == $sysGroupId) { return 'TPkuxuan'; } else if(3 == $sysGroupId) { return 'TPliedou'; } else if (51 == $sysGroupId) { return 'TPxingcheng'; } } } return ''; } # 获取九州平台需要的透传参数 public static function getMsgId($corpid, $externalUserId, $userId = null, $retry = 3) { $query = CustomerDetails::suffix($corpid)->where('corpid', $corpid) ->where('external_userid', $externalUserId); if (empty($userId)) { $dataId = $query->orderBy('createtime', 'desc')->first(['id']); } else { $dataId = $query->where('user_id', $userId)->first(['id']); } $dataId = $dataId->id ?? null; # 当查询客户数据项ID为空时 if(empty($dataId)) { if ($retry-- > 0) { sleep(1); return self::getMsgId($corpid, $externalUserId, $userId, $retry); } else { EmailQueue::rPush('获取九州短剧透传参数异常', json_encode([ 'corpid' => $corpid, 'external_user_id' => $externalUserId, 'user_id' => $userId ], 256), 'song.shen@kuxuan-inc.com', '猎羽'); } } $suffix = get_hash_code($corpid, 50); return $suffix.'|'.$dataId; } }