|
@@ -267,5 +267,49 @@ class LoginController extends BaseController |
|
@@ -267,5 +267,49 @@ class LoginController extends BaseController |
|
267
|
return $data;
|
267
|
return $data;
|
|
268
|
}
|
268
|
}
|
|
269
|
|
269
|
|
|
|
|
270
|
+ public function ceshi(){
|
|
|
|
271
|
+ $templateModel = new TemplateModule();
|
|
|
|
272
|
+ $list = $templateModel->list();
|
|
|
|
273
|
+ foreach ($list as $k => $v){
|
|
|
|
274
|
+ $html = $this->updateHtml();
|
|
|
|
275
|
+ $templateModel->edit(['html'=>$html],['id'=>$v['id']]);
|
|
|
|
276
|
+ }
|
|
|
|
277
|
+ return 1;
|
|
|
|
278
|
+ }
|
|
|
|
279
|
+
|
|
|
|
280
|
+ public function re(&$html,$srcValue,$path){
|
|
|
|
281
|
+ $html = str_replace(
|
|
|
|
282
|
+ $srcValue,
|
|
|
|
283
|
+ $path,
|
|
|
|
284
|
+ $html
|
|
|
|
285
|
+ );
|
|
|
|
286
|
+ return $html;
|
|
|
|
287
|
+ }
|
|
|
|
288
|
+
|
|
|
|
289
|
+ public function updateHtml(){
|
|
|
|
290
|
+ $html = $this->re($v['html'],'admin.item.globalso.site','ecdn6.globalso.com/');
|
|
|
|
291
|
+// $html = $this->re($v['html'],'https://develop.globalso.com/b/image/','https://ecdn6.globalso.com/public/template/');
|
|
|
|
292
|
+ }
|
|
|
|
293
|
+
|
|
|
|
294
|
+ public function updateCe(){
|
|
|
|
295
|
+ $templateModel = new TemplateModule();
|
|
|
|
296
|
+ $list = [];
|
|
|
|
297
|
+ foreach ($list as $k => $v){
|
|
|
|
298
|
+ preg_match_all('/\"https:\/\/develop.globalso.com\/a\/image\/(.*?)\"/', $v['html'], $matches);
|
|
|
|
299
|
+ if (!empty($matches[1])) {
|
|
|
|
300
|
+ $srcValues = $matches[1];
|
|
|
|
301
|
+ $imageModel = new Image();
|
|
|
|
302
|
+ $html = $v['html'];
|
|
|
|
303
|
+ foreach ($srcValues as $srcValue) {
|
|
|
|
304
|
+ $image_info = $imageModel->read(['hash' => $srcValue]);
|
|
|
|
305
|
+ if ($image_info !== false) {
|
|
|
|
306
|
+ $path = basename($image_info['path']);
|
|
|
|
307
|
+ $html = $this->re($html, $srcValue, $path);
|
|
|
|
308
|
+ }
|
|
|
|
309
|
+ }
|
|
|
|
310
|
+ }
|
|
|
|
311
|
+ $templateModel->edit(['html'=>$html],['id'=>$v['id']]);
|
|
|
|
312
|
+ }
|
|
|
|
313
|
+ }
|
|
270
|
|
314
|
|
|
271
|
} |
315
|
} |