作者 lyh

gx

@@ -124,9 +124,20 @@ class LoginController extends BaseController @@ -124,9 +124,20 @@ class LoginController extends BaseController
124 $templateModel = new TemplateModule(); 124 $templateModel = new TemplateModule();
125 $list = $templateModel->list(); 125 $list = $templateModel->list();
126 foreach ($list as $k => $v){ 126 foreach ($list as $k => $v){
127 - unset($v['id']);  
128 - $data = $v;  
129 - DB::table('gl_public_template_module_copy')->insert($data); 127 + preg_match_all('/\"https:\/\/develop.globalso.com\/a\/image\/(.*?)\"/', $v['html'], $matches);
  128 + if (!empty($matches[1])) {
  129 + $srcValues = $matches[1];
  130 + $imageModel = new Image();
  131 + $html = $v['html'];
  132 + foreach ($srcValues as $srcValue) {
  133 + $image_info = $imageModel->read(['hash' => $srcValue]);
  134 + if ($image_info !== false) {
  135 + $path = basename($image_info['path']);
  136 + $html = $this->re($html, $srcValue, $path);
  137 + }
  138 + }
  139 + }
  140 + $templateModel->edit(['html'=>$html],['id'=>$v['id']]);
130 } 141 }
131 return 1; 142 return 1;
132 } 143 }