diff --git a/crmeb/crmeb/services/ApiErrorCode.php b/crmeb/crmeb/services/ApiErrorCode.php deleted file mode 100644 index 8367e64b..00000000 --- a/crmeb/crmeb/services/ApiErrorCode.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @day: 2018/01/23 - */ - -namespace crmeb\services; - - -class ExportService -{ - public static function exportCsv($list, $filename, $header = [], $br = '_') - { - $tableStr = count($header) > 0 ? '"' . implode('","', $header) . '"' . PHP_EOL : ''; - $tableStr .= self::tidyCsvStr($list, str_repeat($br, 99)); - ob_end_clean(); - ob_start(); - header("Content-type:application/vnd.ms-excel"); - header("Content-Disposition:filename=" . $filename . ".csv"); - header('Content-Type:application/download'); - exit(iconv('UTF-8', "GB2312//IGNORE", $tableStr)); - } - - private static function tidyCsvStr($list, $br = '') - { - $tableStr = ''; - foreach ($list as $row) { - if (is_array($row)) { - $max = 1; - foreach ($row as $k => $item) { - if (is_array($item)) { - if ($max < ($l = count($item))) $max = $l; - } else - $row[$k] = [$item]; - } - for ($i = 0; $i <= $max; $i++) { - $exportRow = []; - if ($max == $i) { - if ($br == '') - continue; - else - $exportRow = array_fill(0, count($row), $br); - } else { - foreach ($row as $item) { - $exportRow[] = isset($item[$i]) && !empty($item[$i]) ? $item[$i] : ' '; - } - } - $tableStr .= '"' . implode('","', $exportRow) . '"," "' . PHP_EOL; - } - $tableStr = rtrim($tableStr, PHP_EOL); - } else { - $tableStr .= implode('', ['"', $row, '"', ',']); - } - $tableStr .= PHP_EOL; - } - return $tableStr; - } -} \ No newline at end of file diff --git a/crmeb/crmeb/services/ExpressService.php b/crmeb/crmeb/services/ExpressService.php index ed623601..6b1c6b43 100644 --- a/crmeb/crmeb/services/ExpressService.php +++ b/crmeb/crmeb/services/ExpressService.php @@ -19,7 +19,7 @@ class ExpressService public static function query($no, $type = '') { - $appCode = SystemConfigService::config('system_express_app_code'); + $appCode = sysConfig('system_express_app_code'); if (!$appCode) return false; $res = HttpService::getRequest(self::$api['query'], compact('no', 'type'), ['Authorization:APPCODE ' . $appCode]); $result = json_decode($res, true) ?: false; diff --git a/crmeb/crmeb/services/CanvasService.php b/crmeb/crmeb/utils/CanvasService.php similarity index 99% rename from crmeb/crmeb/services/CanvasService.php rename to crmeb/crmeb/utils/CanvasService.php index 65718448..f5d1620b 100644 --- a/crmeb/crmeb/services/CanvasService.php +++ b/crmeb/crmeb/utils/CanvasService.php @@ -1,6 +1,6 @@