|
@@ -9,7 +9,9 @@ |
|
@@ -9,7 +9,9 @@ |
|
9
|
|
9
|
|
|
10
|
namespace App\Console\Commands\CropImage;
|
10
|
namespace App\Console\Commands\CropImage;
|
|
11
|
|
11
|
|
|
|
|
12
|
+use App\Enums\Common\Code;
|
|
12
|
use App\Models\Domain\DomainInfo;
|
13
|
use App\Models\Domain\DomainInfo;
|
|
|
|
14
|
+use App\Models\File\Image;
|
|
13
|
use App\Models\WebSetting\AggregationSetting;
|
15
|
use App\Models\WebSetting\AggregationSetting;
|
|
14
|
use App\Models\WebSetting\WebSettingImage;
|
16
|
use App\Models\WebSetting\WebSettingImage;
|
|
15
|
use App\Services\CosService;
|
17
|
use App\Services\CosService;
|
|
@@ -131,7 +133,6 @@ class CropImage extends Command |
|
@@ -131,7 +133,6 @@ class CropImage extends Command |
|
131
|
$data[] = $banner_dom ? $banner_dom->src : '';
|
133
|
$data[] = $banner_dom ? $banner_dom->src : '';
|
|
132
|
$dom->clear();
|
134
|
$dom->clear();
|
|
133
|
unset($dom);
|
135
|
unset($dom);
|
|
134
|
- $data[] = $banner_dom ? $banner_dom->src : '';
|
|
|
|
135
|
}
|
136
|
}
|
|
136
|
}else{
|
137
|
}else{
|
|
137
|
$this->output('域名不存在: ' . $project_id);
|
138
|
$this->output('域名不存在: ' . $project_id);
|
|
@@ -140,6 +141,35 @@ class CropImage extends Command |
|
@@ -140,6 +141,35 @@ class CropImage extends Command |
|
140
|
}
|
141
|
}
|
|
141
|
|
142
|
|
|
142
|
/**
|
143
|
/**
|
|
|
|
144
|
+ * @remark :写入数据库
|
|
|
|
145
|
+ * @name :saveMysql
|
|
|
|
146
|
+ * @author :lyh
|
|
|
|
147
|
+ * @method :post
|
|
|
|
148
|
+ * @time :2025/5/8 14:59
|
|
|
|
149
|
+ */
|
|
|
|
150
|
+ public function saveMysql($size,$image_type,$fileName,$hash,$is_cos = 0,$mime = '', $name=''){
|
|
|
|
151
|
+ $imageModel = new Image();
|
|
|
|
152
|
+ $data = [
|
|
|
|
153
|
+ 'path' => $this->path.'/'.$fileName,
|
|
|
|
154
|
+ 'created_at' => date('Y-m-d H:i:s',time()),
|
|
|
|
155
|
+ 'size' => $size,
|
|
|
|
156
|
+ 'hash' => $hash,
|
|
|
|
157
|
+ 'type'=>$image_type,
|
|
|
|
158
|
+ 'refer'=>$this->param['refer'] ?? 0,
|
|
|
|
159
|
+ 'is_cos'=>($is_cos == 0) ? 1 : 0,
|
|
|
|
160
|
+ 'mime'=>$mime,
|
|
|
|
161
|
+ 'project_id'=>$this->cache['project_id'] ?? 0,
|
|
|
|
162
|
+ 'name'=>$name,
|
|
|
|
163
|
+ 'en_name'=>$fileName
|
|
|
|
164
|
+ ];
|
|
|
|
165
|
+ $rs = $imageModel->add($data);
|
|
|
|
166
|
+ if ($rs === false) {
|
|
|
|
167
|
+ return $this->response('添加失败', Code::USER_ERROR);
|
|
|
|
168
|
+ }
|
|
|
|
169
|
+ return true;
|
|
|
|
170
|
+ }
|
|
|
|
171
|
+
|
|
|
|
172
|
+ /**
|
|
143
|
* @remark :记录日志
|
173
|
* @remark :记录日志
|
|
144
|
* @name :output
|
174
|
* @name :output
|
|
145
|
* @author :lyh
|
175
|
* @author :lyh
|