作者 lyh

gx

@@ -119,24 +119,14 @@ class LoginController extends BaseController @@ -119,24 +119,14 @@ class LoginController extends BaseController
119 $this->response('success',Code::SUCCESS,strtolower($str)); 119 $this->response('success',Code::SUCCESS,strtolower($str));
120 } 120 }
121 121
  122 +
122 public function ceshi(){ 123 public function ceshi(){
123 $templateModel = new TemplateModule(); 124 $templateModel = new TemplateModule();
124 $list = $templateModel->list(); 125 $list = $templateModel->list();
125 foreach ($list as $k => $v){ 126 foreach ($list as $k => $v){
126 - preg_match_all('/\"https:\/\/develop.globalso.com\/a\/image\/(.*?)\"/', $v['html'], $matches);  
127 - if (!empty($matches[1])) {  
128 - $srcValues = $matches[1];  
129 - $imageModel = new Image();  
130 - $html = $v['html'];  
131 - foreach ($srcValues as $srcValue) {  
132 - $image_info = $imageModel->read(['hash' => $srcValue]);  
133 - if ($image_info !== false) {  
134 - $path = basename($image_info['path']);  
135 - $html = $this->re($html, $srcValue, $path);  
136 - }  
137 - }  
138 - }  
139 - $templateModel->edit(['html'=>$html],['id'=>$v['id']]); 127 + unset($v['id']);
  128 + $data = $v;
  129 + DB::table('gl_public_template_module_copy')->insert($data);
140 } 130 }
141 return 1; 131 return 1;
142 } 132 }
@@ -155,5 +145,24 @@ class LoginController extends BaseController @@ -155,5 +145,24 @@ class LoginController extends BaseController
155 $html = $this->re($v['html'],'https://develop.globalso.com/b/image/','https://ecdn6.globalso.com/public/template/'); 145 $html = $this->re($v['html'],'https://develop.globalso.com/b/image/','https://ecdn6.globalso.com/public/template/');
156 } 146 }
157 147
158 - 148 + public function updateCe(){
  149 + $templateModel = new TemplateModule();
  150 + $list = [];
  151 + foreach ($list as $k => $v){
  152 + preg_match_all('/\"https:\/\/develop.globalso.com\/a\/image\/(.*?)\"/', $v['html'], $matches);
  153 + if (!empty($matches[1])) {
  154 + $srcValues = $matches[1];
  155 + $imageModel = new Image();
  156 + $html = $v['html'];
  157 + foreach ($srcValues as $srcValue) {
  158 + $image_info = $imageModel->read(['hash' => $srcValue]);
  159 + if ($image_info !== false) {
  160 + $path = basename($image_info['path']);
  161 + $html = $this->re($html, $srcValue, $path);
  162 + }
  163 + }
  164 + }
  165 + $templateModel->edit(['html'=>$html],['id'=>$v['id']]);
  166 + }
  167 + }
159 } 168 }