You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
honor-dd-light-ds-java/doc/source/const/class.DsAppTool.php

46 lines
2.2 KiB
PHP

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
class DsAppTool {
public static function getDsApiFailReason($reason, $memberAuthUrl) {
$newReason = $reason;
if (stripos($reason, 'authorized') !== false) {
$newReason = sprintf('【%s】授权已过期请重新授权<a href="%s" target="_blank" class="btn btn-sm btn-warning"><b>立即授权</b></a>', DsConst::getDsAppChineseName(), $memberAuthUrl);
}
if (stripos($reason, '已下架') !== false) {
$newReason = '1688商品已下架请更换货源后采购';
}
if (stripos($reason, '已删除') !== false) {
$newReason = '1688商品已删除请更换货源后采购';
}
return $newReason;
}
public static function rebuildCheckDsAppAuthExpireRet($ret, $loginUserId) {
$ret['loginUserId'] = $loginUserId;
$memberAuthUrl = $ret['memberAuthUrl'];
foreach ($ret['userIdAndCheckRetMap'] as $userId => &$checkRet) {
if (CommonTool::isSuccessRet($checkRet)) {
continue;
}
if ($checkRet['code'] == DsConst::authExpireTypeOrderExpire) {
$checkRet['solution'] = sprintf('1688%s已过期为了避免影响正常发货和使用请<a target="_blank" href="%s">重新订购</a>', DsConst::getDsAppChineseName(), DsConst::getDsAppServiceMarketUrl());
$checkRet['tip'] = sprintf('1688%s订购过期为了避免影响正常发货和使用请<a target="_blank" href="%s">先去订购</a>', DsConst::getDsAppChineseName(), DsConst::getDsAppServiceMarketUrl());
} elseif ($checkRet['code'] == DsConst::authExpireTypeAuthExpire) {
$checkRet['solution'] = sprintf('1688%s授权失效为了避免影响正常发货和使用请<a target="_blank" href="%s">重新授权</a>', DsConst::getDsAppChineseName(), $memberAuthUrl);
$checkRet['tip'] = sprintf('1688%s授权失效为了避免影响正常发货和使用请<a target="_blank" href="%s">重新授权</a>', DsConst::getDsAppChineseName(), $memberAuthUrl);
} else {
$checkRet['solution'] = $checkRet['reason'];
}
}
unset($checkRet);
return $ret;
}
}