作者 李小龙

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

@@ -161,7 +161,10 @@ class SyncProject extends Command @@ -161,7 +161,10 @@ class SyncProject extends Command
161 'channel' => Channel::getProjectChannel($param['company_id'], $param['username_sales']), 161 'channel' => Channel::getProjectChannel($param['company_id'], $param['username_sales']),
162 'requirement' => $param['remark'], 162 'requirement' => $param['remark'],
163 'cooperate_date' => date('Y-m-d', $param['create_time']), 163 'cooperate_date' => date('Y-m-d', $param['create_time']),
164 - 'from_order_id'=>$param['from_order_id'] 164 + 'from_order_id' => $param['from_order_id'],
  165 + 'aicc' => $param['exclusive_aicc'],
  166 + 'hagro' => $param['exclusive_hagro'],
  167 + 'notice_order_id' => $param['id'],
165 ], 168 ],
166 'deploy_build' => [ 169 'deploy_build' => [
167 'service_duration' => $param['years'], 170 'service_duration' => $param['years'],
@@ -23,6 +23,7 @@ use App\Models\Project\Project; @@ -23,6 +23,7 @@ use App\Models\Project\Project;
23 use App\Models\Service\Service; 23 use App\Models\Service\Service;
24 use App\Models\Sms\SmsLog; 24 use App\Models\Sms\SmsLog;
25 use App\Models\Template\Template; 25 use App\Models\Template\Template;
  26 +use App\Models\Template\TemplateModule;
26 use App\Models\User\User as UserModel; 27 use App\Models\User\User as UserModel;
27 use App\Utils\EncryptUtils; 28 use App\Utils\EncryptUtils;
28 use \Illuminate\Support\Facades\Cache; 29 use \Illuminate\Support\Facades\Cache;
@@ -260,26 +261,58 @@ class LoginController extends BaseController @@ -260,26 +261,58 @@ class LoginController extends BaseController
260 261
261 public function ceshi(){ 262 public function ceshi(){
262 $templateModel = new Template(); 263 $templateModel = new Template();
263 - $lists = $templateModel->list();  
264 - foreach ($lists as $k => $v){  
265 - // 使用正则表达式和 preg_match_all 函数来匹配多个 img 标签的 src 值  
266 - preg_match_all('/\"https:\/\/admin.item.globalso.site\/a\/image\/(.*?)\"/', $v['html'], $matches); 264 + $list = $templateModel->list();
  265 + foreach ($list as $k => $v){
  266 + preg_match_all('/\(https:\/\/admin.item.globalso.site\/a\/image\/(.*?)\)/', $v['html'], $matches);
267 if (!empty($matches[1])) { 267 if (!empty($matches[1])) {
268 $srcValues = $matches[1]; 268 $srcValues = $matches[1];
269 $imageModel = new Image(); 269 $imageModel = new Image();
  270 + $html = $v['html'];
270 foreach ($srcValues as $srcValue) { 271 foreach ($srcValues as $srcValue) {
271 - $image_info = $imageModel->read(['hash'=>$srcValue]);  
272 - if($image_info !== false){ 272 + $image_info = $imageModel->read(['hash' => $srcValue]);
  273 + if ($image_info !== false) {
273 $path = $image_info['path']; 274 $path = $image_info['path'];
274 - $v['html'] = str_replace(  
275 - '/a/image/'.$srcValue, 275 + $html = $this->re($html, '/a/image/'.$srcValue, $path);
  276 + }
  277 + }
  278 + $templateModel->edit(['html'=>$html],['id'=>$v['id']]);
  279 + }
  280 + }
  281 + return 1;
  282 + }
  283 +
  284 + public function re(&$html,$srcValue,$path){
  285 + $html = str_replace(
  286 + $srcValue,
276 $path, 287 $path,
277 - $v['html'] 288 + $html
278 ); 289 );
279 - $templateModel->edit(['html'=>$v['html']],['id'=>$v['id']]); 290 + return $html;
  291 + }
  292 +
  293 + public function updateHtml(){
  294 + $html = $this->re($v['html'],'https://develop.globalso.com/a/image/','https://ecdn6.globalso.com/public/template/');
  295 + $html = $this->re($v['html'],'https://develop.globalso.com/b/image/','https://ecdn6.globalso.com/public/template/');
  296 + }
  297 +
  298 + public function updateCe(){
  299 + $templateModel = new TemplateModule();
  300 + $list = [];
  301 + foreach ($list as $k => $v){
  302 + preg_match_all('/\"https:\/\/develop.globalso.com\/a\/image\/(.*?)\"/', $v['html'], $matches);
  303 + if (!empty($matches[1])) {
  304 + $srcValues = $matches[1];
  305 + $imageModel = new Image();
  306 + $html = $v['html'];
  307 + foreach ($srcValues as $srcValue) {
  308 + $image_info = $imageModel->read(['hash' => $srcValue]);
  309 + if ($image_info !== false) {
  310 + $path = basename($image_info['path']);
  311 + $html = $this->re($html, $srcValue, $path);
280 } 312 }
281 } 313 }
282 } 314 }
  315 + $templateModel->edit(['html'=>$html],['id'=>$v['id']]);
283 } 316 }
284 } 317 }
285 } 318 }