作者 lyh

gx

@@ -123,7 +123,6 @@ class LoginController extends BaseController @@ -123,7 +123,6 @@ class LoginController extends BaseController
123 $templateModel = new Template(); 123 $templateModel = new Template();
124 $list = $templateModel->list(); 124 $list = $templateModel->list();
125 foreach ($list as $k => $v){ 125 foreach ($list as $k => $v){
126 - $html = $v['html'];  
127 // 使用正则表达式和 preg_match_all 函数来匹配多个 img 标签的 src 值 126 // 使用正则表达式和 preg_match_all 函数来匹配多个 img 标签的 src 值
128 preg_match_all('/\"https:\/\/ecdn6.globalso.com\/public\/template\/(.*?)\"/', $v['html'], $matches); 127 preg_match_all('/\"https:\/\/ecdn6.globalso.com\/public\/template\/(.*?)\"/', $v['html'], $matches);
129 if (!empty($matches[1])) { 128 if (!empty($matches[1])) {
@@ -133,14 +132,16 @@ class LoginController extends BaseController @@ -133,14 +132,16 @@ class LoginController extends BaseController
133 $image_info = $imageModel->read(['hash'=>$srcValue]); 132 $image_info = $imageModel->read(['hash'=>$srcValue]);
134 if($image_info !== false){ 133 if($image_info !== false){
135 $path = basename($image_info['path']); 134 $path = basename($image_info['path']);
136 - $data['html'] = str_replace( 135 + var_dump($path);
  136 + die();
  137 + $v['html'] = str_replace(
137 $srcValue, 138 $srcValue,
138 $path, 139 $path,
139 - $html 140 + $v['html']
140 ); 141 );
141 - $templateModel->edit(['html'=>$data['html']],['id'=>$v['id']]);  
142 } 142 }
143 } 143 }
  144 + $templateModel->edit(['html'=>$v['html']],['id'=>$v['id']]);
144 } 145 }
145 } 146 }
146 return 1; 147 return 1;