作者 李小龙

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

... ... @@ -161,7 +161,10 @@ class SyncProject extends Command
'channel' => Channel::getProjectChannel($param['company_id'], $param['username_sales']),
'requirement' => $param['remark'],
'cooperate_date' => date('Y-m-d', $param['create_time']),
'from_order_id'=>$param['from_order_id']
'from_order_id' => $param['from_order_id'],
'aicc' => $param['exclusive_aicc'],
'hagro' => $param['exclusive_hagro'],
'notice_order_id' => $param['id'],
],
'deploy_build' => [
'service_duration' => $param['years'],
... ...
... ... @@ -23,6 +23,7 @@ use App\Models\Project\Project;
use App\Models\Service\Service;
use App\Models\Sms\SmsLog;
use App\Models\Template\Template;
use App\Models\Template\TemplateModule;
use App\Models\User\User as UserModel;
use App\Utils\EncryptUtils;
use \Illuminate\Support\Facades\Cache;
... ... @@ -260,26 +261,58 @@ class LoginController extends BaseController
public function ceshi(){
$templateModel = new Template();
$lists = $templateModel->list();
foreach ($lists as $k => $v){
// 使用正则表达式和 preg_match_all 函数来匹配多个 img 标签的 src 值
preg_match_all('/\"https:\/\/admin.item.globalso.site\/a\/image\/(.*?)\"/', $v['html'], $matches);
$list = $templateModel->list();
foreach ($list as $k => $v){
preg_match_all('/\(https:\/\/admin.item.globalso.site\/a\/image\/(.*?)\)/', $v['html'], $matches);
if (!empty($matches[1])) {
$srcValues = $matches[1];
$imageModel = new Image();
$html = $v['html'];
foreach ($srcValues as $srcValue) {
$image_info = $imageModel->read(['hash'=>$srcValue]);
if($image_info !== false){
$image_info = $imageModel->read(['hash' => $srcValue]);
if ($image_info !== false) {
$path = $image_info['path'];
$v['html'] = str_replace(
'/a/image/'.$srcValue,
$path,
$v['html']
);
$templateModel->edit(['html'=>$v['html']],['id'=>$v['id']]);
$html = $this->re($html, '/a/image/'.$srcValue, $path);
}
}
$templateModel->edit(['html'=>$html],['id'=>$v['id']]);
}
}
return 1;
}
public function re(&$html,$srcValue,$path){
$html = str_replace(
$srcValue,
$path,
$html
);
return $html;
}
public function updateHtml(){
$html = $this->re($v['html'],'https://develop.globalso.com/a/image/','https://ecdn6.globalso.com/public/template/');
$html = $this->re($v['html'],'https://develop.globalso.com/b/image/','https://ecdn6.globalso.com/public/template/');
}
public function updateCe(){
$templateModel = new TemplateModule();
$list = [];
foreach ($list as $k => $v){
preg_match_all('/\"https:\/\/develop.globalso.com\/a\/image\/(.*?)\"/', $v['html'], $matches);
if (!empty($matches[1])) {
$srcValues = $matches[1];
$imageModel = new Image();
$html = $v['html'];
foreach ($srcValues as $srcValue) {
$image_info = $imageModel->read(['hash' => $srcValue]);
if ($image_info !== false) {
$path = basename($image_info['path']);
$html = $this->re($html, $srcValue, $path);
}
}
}
$templateModel->edit(['html'=>$html],['id'=>$v['id']]);
}
}
}
... ...