update
This commit is contained in:
12
app/Constants/Config.php
Normal file
12
app/Constants/Config.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Constants;
|
||||||
|
|
||||||
|
use Hyperf\Constants\AbstractConstants;
|
||||||
|
|
||||||
|
#[Constants]
|
||||||
|
class Config extends AbstractConstants
|
||||||
|
{
|
||||||
|
//以下为图片业务自定义常量
|
||||||
|
public const DOMAIN = "https://seo.23cm.cn";
|
||||||
|
}
|
@ -133,7 +133,7 @@ class UploadController extends AbstractController
|
|||||||
// 保存路径
|
// 保存路径
|
||||||
$filename = uniqid() . '.' . pathinfo($file->getClientFilename(), PATHINFO_EXTENSION);
|
$filename = uniqid() . '.' . pathinfo($file->getClientFilename(), PATHINFO_EXTENSION);
|
||||||
$date = date('m-d');
|
$date = date('m-d');
|
||||||
$targetPath = BASE_PATH . '/uploads/' . $filename;
|
$targetPath = BASE_PATH . '/public/uploads/search-image/' . $date . '/' . $filename;
|
||||||
|
|
||||||
// 确保目录存在
|
// 确保目录存在
|
||||||
if (!is_dir(dirname($targetPath))) {
|
if (!is_dir(dirname($targetPath))) {
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Controller\admin\api;
|
namespace App\Controller\admin\api;
|
||||||
|
|
||||||
|
use App\Constants\Config;
|
||||||
use App\Controller\AbstractController;
|
use App\Controller\AbstractController;
|
||||||
use App\Helpers\ExcelHelper;
|
use App\Helpers\ExcelHelper;
|
||||||
use App\Model\AppKeywordsMonitor;
|
use App\Model\AppKeywordsMonitor;
|
||||||
@ -171,7 +172,7 @@ class KeywordsController extends AbstractController
|
|||||||
|
|
||||||
foreach ($res as &$v) {
|
foreach ($res as &$v) {
|
||||||
$v['keyword'] = AppKeywordsMonitorTask::find($v['aid'])->keyword;
|
$v['keyword'] = AppKeywordsMonitorTask::find($v['aid'])->keyword;
|
||||||
$v['screen_path'] = 'http://127..0.0.1:9503' . $v['screen_path'];
|
$v['screen_path'] = Config::DOMAIN . $v['screen_path'];
|
||||||
}
|
}
|
||||||
$fileName = date('Y-m-d') . '关键词监控结果';
|
$fileName = date('Y-m-d') . '关键词监控结果';
|
||||||
return ExcelHelper::exportData($this->response, list: $res, header: [
|
return ExcelHelper::exportData($this->response, list: $res, header: [
|
||||||
|
Reference in New Issue
Block a user