作者 赵彬吉
... ... @@ -102,10 +102,10 @@ class DomainInfo extends Command
$domain_array = parse_url($v['domain']);
$host = $domain_array['host'] ?? $domain_array['path'];
$host_array = explode('.', $host);
if($host_array[0] == 'www'){
if (count($host_array) <= 2) {
array_unshift($host_array, 'm');
} else {
$host_array[0] = 'm';
}else{
array_unshift($host_array,'m');
}
$amp_domain = implode('.', $host_array);
... ... @@ -192,10 +192,10 @@ class DomainInfo extends Command
$domain_array = parse_url($v['domain']);
$host = $domain_array['host'] ?? $domain_array['path'];
$host_array = explode('.', $host);
if($host_array[0] == 'www'){
if (count($host_array) <= 2) {
array_unshift($host_array, 'm');
} else {
$host_array[0] = 'm';
}else{
array_unshift($host_array,'m');
}
$amp_domain = implode('.', $host_array);
... ...
... ... @@ -135,7 +135,7 @@ class MonthAllCount extends Command
->where('updated_date','>=',$start.' 00:00:00')
->where('updated_date','<=',$end.' 23:59:59')->count();
if($arr['ip'] != 0){
$arr['rate'] = round((($arr['month_total'] ?? 0) / $arr['ip']) * 10,2);
$arr['rate'] = round((($arr['month_total'] ?? 0) / $arr['ip']) * 100,2);
}
return $arr;
}
... ...
... ... @@ -158,7 +158,7 @@ class MonthCount extends Command
->where('updated_date','>=',$start.' 00:00:00')
->where('updated_date','<=',$end.' 23:59:59')->count();
if($arr['ip'] != 0){
$arr['rate'] = round((($arr['month_total'] ?? 0) / $arr['ip']) * 10,2);
$arr['rate'] = round((($arr['month_total'] ?? 0) / $arr['ip']) * 100,2);
}
return $arr;
}
... ...
... ... @@ -159,7 +159,7 @@ class MonthCountDate extends Command
->where('updated_date','>=',$start.' 00:00:00')
->where('updated_date','<=',$end.' 23:59:59')->count();
if($arr['ip'] != 0){
$arr['rate'] = round((($arr['month_total'] ?? 0) / $arr['ip']) * 10,2);
$arr['rate'] = round((($arr['month_total'] ?? 0) / $arr['ip']) * 100,2);
}
return $arr;
}
... ...
... ... @@ -135,7 +135,7 @@ class MonthProjectCount extends Command
->where('updated_date','>=',$start.' 00:00:00')
->where('updated_date','<=',$end.' 23:59:59')->count();
if($arr['ip'] != 0){
$arr['rate'] = round(($arr['month_total'] / $arr['ip']) * 10,2);
$arr['rate'] = round(($arr['month_total'] / $arr['ip']) * 100,2);
}
return $arr;
}
... ...
... ... @@ -43,7 +43,7 @@ class SendProduct extends Command
*/
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['deleted_status'=>0]);
$list = $projectModel->list(['delete_status'=>0]);
$data = [];
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
... ... @@ -56,16 +56,19 @@ class SendProduct extends Command
$arr1 = $this->sendProduct();
$arr2 = $this->sendBlog();
$arr3 = $this->sendNews();
$url = array_merge((array)$arr1,(array)$arr2,(array)$arr3);
if(!empty($url)){
$c_url = $domain.'api/update_page/';
$param = [
'project_id' => $this->user['project_id'],
'project_id' => $v['id'],
'type' => 1,
'route' => 3,
'url' => array_merge($arr1,$arr2,$arr3),
'url' => $url,
'language'=> [],
'is_sitemap' => 0
];
http_post($c_url, json_encode($param));
}
//TODO::通知C端生成界面
DB::disconnect('custom_mysql');
}
... ... @@ -80,10 +83,10 @@ class SendProduct extends Command
* @time :2024/8/30 14:44
*/
public function sendProduct(){
$start_date = date('Y-m-d H:i:s');
$start_date = date('Y-m-d 00:00:00');
$end_date = date('Y-m-d 23:59:59');
$productModel = new Product();
$arr = $productModel->formatQuery(['send_time'=>['between',[$start_date,$end_date]],'status'=>3])->pluck('route');
$arr = $productModel->formatQuery(['send_time'=>['between',[$start_date,$end_date]],'status'=>3])->pluck('route')->toArray();
$productModel->edit(['status'=>1],['send_time'=>['between',[$start_date,$end_date]],'status'=>3]);
return $arr;
}
... ... @@ -96,10 +99,10 @@ class SendProduct extends Command
* @time :2024/8/30 15:19
*/
public function sendBlog(){
$start_date = date('Y-m-d H:i:s');
$start_date = date('Y-m-d 00:00:00');
$end_date = date('Y-m-d 23:59:59');
$blogModel = new Blog();
$arr = $blogModel->formatQuery(['release_at'=>['between',[$start_date,$end_date]],'status'=>3])->pluck('url');
$arr = $blogModel->formatQuery(['release_at'=>['between',[$start_date,$end_date]],'status'=>3])->pluck('url')->toArray();
$blogModel->edit(['status'=>1],['release_at'=>['between',[$start_date,$end_date]],'status'=>3]);
return $arr;
}
... ... @@ -112,10 +115,10 @@ class SendProduct extends Command
* @time :2024/8/30 15:19
*/
public function sendNews(){
$start_date = date('Y-m-d H:i:s');
$start_date = date('Y-m-d 00:00:00');
$end_date = date('Y-m-d 23:59:59');
$newsModel = new News();
$arr = $newsModel->formatQuery(['release_at'=>['between',[$start_date,$end_date]],'status'=>3])->pluck('url');
$arr = $newsModel->formatQuery(['release_at'=>['between',[$start_date,$end_date]],'status'=>3])->pluck('url')->toArray();
$newsModel->edit(['status'=>1],['release_at'=>['between',[$start_date,$end_date]],'status'=>3]);
return $arr;
}
... ...
<?php
/**
* @remark :
* @name :CopyProject.php
* @author :lyh
* @method :post
* @time :2025/1/15 14:40
*/
namespace App\Jobs;
namespace App\Console\Commands\Project;
use App\Events\CopyProject;
use App\Events\UpdateHtml;
use App\Jobs\updateHtmlJob;
use App\Models\Com\NoticeLog;
use App\Models\Project\After;
use App\Models\Project\DeployBuild;
use App\Models\Project\DeployOptimize;
... ... @@ -14,48 +19,73 @@ use App\Models\Template\Setting;
use App\Models\User\User as UserModel;
use App\Services\ProjectServer;
use Hashids\Hashids;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Schema;
class CopyProjectJob implements ShouldQueue
class CopyProject extends Command
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public $tries = 3; // 可配置任务重试次数
protected $param;
/**
* Create a new job instance.
* The name and signature of the console command.
*
* @param CopyImageFile $event
* @return void
* @var string
*/
public function __construct($data)
{
$this->param = $data;
}
protected $signature = 'copy_project';
/**
* Handle the event.
* The console command description.
*
* @param UpdateHtml $event
* @return void
* @var string
*/
protected $description = 'copy--复制项目';
public function handle()
{
$projectModel = new Project();
while (true) {
$list = NoticeLog::where('type', NoticeLog::TYPE_COPY_PROJECT)->where('status', NoticeLog::STATUS_PENDING)->get();
if(empty($list)){
sleep(5);
continue;
}
foreach ($list as $item){
DB::beginTransaction();
try {
$this->output('CopyProjectJob start, project_id: ' . $this->param['project_id']);
//复制初始项目
$data = $projectModel::where('id', $this->param['project_id'])->first();
$old_project_id = $item['data']['project_id'];
$this->output('CopyProjectJob start, project_id: ' . $old_project_id);
$data = $this->copyProject($old_project_id);
$project_id = $data['project_id'];
$type = $data['type'];
$this->copyDeployBuild($old_project_id,$project_id);
$this->copyDeployOptimize($old_project_id,$project_id);
$this->copyPayment($old_project_id,$project_id);
$this->copyAfter($old_project_id,$project_id);
$this->copyUser($old_project_id,$project_id);
if($type != 0){
$this->copyMysql($old_project_id,$project_id);
}
//修改项目状态
$projectModel->edit(['delete_status'=>0],['id'=>$project_id]);
$this->output('CopyProjectJob end, old project_id: ' . $old_project_id . ', new project_id: ' . $project_id);
$item->status = NoticeLog::STATUS_SUCCESS;
$item->save();
DB::commit();
}catch (\Exception $e){
DB::rollBack();
echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL . date('Y-m-d H:i:s');
errorLog('项目初始化失败', $item, $e);
$item->status = NoticeLog::STATUS_FAIL;
$item->save();
}
}
}
return true;
}
public function copyProject($old_project_id){
$projectModel = new Project();
$data = $projectModel::where('id', $old_project_id)->first();
$data = $data->getAttributes();
$type = $data['type'];
$data['type'] = 0;
... ... @@ -69,7 +99,7 @@ class CopyProjectJob implements ShouldQueue
$projectModel->edit(['from_order_id'=>$hashids->encode($project_id)],['id'=>$project_id]);
//复制设置的模版
$settingTemplateModel = new Setting();
$settingData = $settingTemplateModel::where('project_id', $this->param['project_id'])->first();
$settingData = $settingTemplateModel::where('project_id', $old_project_id)->first();
if(!empty($settingData)){
$data = [
'template_id' =>$settingData['template_id'],
... ... @@ -77,9 +107,20 @@ class CopyProjectJob implements ShouldQueue
];
$settingTemplateModel->add($data);
}
return ['project_id'=>$project_id,'type'=>$type];
}
/**
* @remark :复制部署表
* @name :copyDeployBuild
* @author :lyh
* @method :post
* @time :2025/1/15 14:59
*/
public function copyDeployBuild($old_project_id,$project_id){
//复制部署表
$buildModel = new DeployBuild();
$buildData = $buildModel::where('project_id', $this->param['project_id'])->first();
$buildData = $buildModel::where('project_id', $old_project_id)->first();
if(!empty($buildData)){
$buildData = $buildData->getAttributes();
$buildData['project_id'] = $project_id;
... ... @@ -89,9 +130,20 @@ class CopyProjectJob implements ShouldQueue
unset($buildData['id']);
$buildModel->insert($buildData);
}
return true;
}
/**
* @remark :复制优化表
* @name :copyDeployOptimize
* @author :lyh
* @method :post
* @time :2025/1/15 15:02
*/
public function copyDeployOptimize($old_project_id,$project_id){
//复制优化表
$optimizeModel = new DeployOptimize();
$optimizeData = $optimizeModel::where('project_id', $this->param['project_id'])->first();
$optimizeData = $optimizeModel::where('project_id', $old_project_id)->first();
if(!empty($optimizeData)){
$optimizeData = $optimizeData->getAttributes();
unset($optimizeData['id'],$optimizeData['domain'],$optimizeData['backlink'],$optimizeData['ai_video']);
... ... @@ -99,45 +151,59 @@ class CopyProjectJob implements ShouldQueue
$optimizeData['api_no'] = 0;
$optimizeModel->insert($optimizeData);
}
return true;
}
/**
* @remark :复制付费表
* @name :copyPayment
* @author :lyh
* @method :post
* @time :2025/1/15 15:03
*/
public function copyPayment($old_project_id,$project_id){
//复制付费表
$paymentModel = new Payment();
$paymentData = $paymentModel::where('project_id', $this->param['project_id'])->first();
$paymentData = $paymentModel::where('project_id', $old_project_id)->first();
if(!empty($paymentData)){
$paymentData = $paymentData->getAttributes();
unset($paymentData['id']);
$paymentData['project_id'] = $project_id;
$paymentModel->insert($paymentData);
}
return true;
}
public function copyAfter($old_project_id,$project_id){
//复制售后表
$afterModel = new After();
$afterData = $afterModel::where('project_id', $this->param['project_id'])->first();
$afterData = $afterModel::where('project_id',$old_project_id)->first();
if(!empty($afterData)){
$afterData = $afterData->getAttributes();
unset($afterData['id']);
$afterData['project_id'] = $project_id;
$afterModel->insert($afterData);
}
return true;
}
/**
* @remark :复制user
* @name :copyUser
* @author :lyh
* @method :post
* @time :2025/1/15 15:04
*/
public function copyUser($old_project_id,$project_id){
//复制用户
$userModel = new UserModel();
$userData = $userModel::where('project_id', $this->param['project_id'])->where('role_id',0)->first();
$userData = $userModel::where('project_id', $old_project_id)->where('role_id',0)->first();
if(!empty($userData)){
$userData = $userData->getAttributes();
unset($userData['id']);
$userData['project_id'] = $project_id;
$userModel->insert($userData);
}
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->output('CopyProjectJob error, error message: ' . $e->getMessage());
$this->fail('error');
}
if($type != 0){
$this->copyMysql($this->param['project_id'],$project_id);
}
//修改项目状态
$projectModel->edit(['delete_status'=>0],['id'=>$project_id]);
$this->output('CopyProjectJob end, old project_id: ' . $this->param['project_id'] . ', new project_id: ' . $project_id);
return true;
}
... ... @@ -200,4 +266,5 @@ class CopyProjectJob implements ShouldQueue
Log::info($output);
return true;
}
}
... ...
... ... @@ -33,7 +33,7 @@ class Temp extends Command
public function handle()
{
$this->create_all_amp_notify();
}
/**
... ... @@ -437,10 +437,10 @@ class Temp extends Command
$domain_array = parse_url($domain);
$host = $domain_array['host'] ?? $domain_array['path'];
$host_array = explode('.', $host);
if ($host_array[0] == 'www') {
$host_array[0] = 'm';
} else {
if (count($host_array) <= 2) {
array_unshift($host_array, 'm');
} else {
$host_array[0] = 'm';
}
$amp_domain = implode('.', $host_array);
... ...
... ... @@ -258,11 +258,15 @@ class ProjectController extends BaseController
*/
public function searchDept(&$query){
if(!empty($this->map['dept_id'])){
if($this->map['dept_id'] == 7 || $this->map['dept_id'] == 9){//7,9代表合并组H+F组
$query->whereIn('gl_project_deploy_build.dept_id', [7,9]);
}else{
$query->where(function ($subQuery) {
$subQuery->orwhere('gl_project_deploy_build.dept_id',$this->map['dept_id'])
->orwhere('gl_project_deploy_optimize.dept_id',$this->map['dept_id']);
});
}
}
return $query;
}
... ... @@ -310,7 +314,7 @@ class ProjectController extends BaseController
$info = $managerHr->read(['manage_id'=>$this->manage['id']]);
//获取当前用户自己的项目
$query->where(function ($subQuery) use ($info) {
$subQuery->whereIn('gl_project.id',[1])//项目1+项目3默认显示
$subQuery->whereIn('gl_project.id', [1]) // 项目1 + 项目3默认显示
->orWhere('gl_project_deploy_build.leader_mid', $info['id'])
->orWhere('gl_project_deploy_build.manager_mid', $info['id'])
->orWhere('gl_project_deploy_build.designer_mid', $info['id'])
... ... @@ -321,9 +325,18 @@ class ProjectController extends BaseController
->orWhere('gl_project_deploy_optimize.tech_mid', $info['id'])
->orWhere('gl_project_deploy_optimize.tech_leader', $info['id'])
->orWhere('gl_project_deploy_optimize.quality_mid', $info['id'])
->orWhere('gl_project_deploy_optimize.design_mid', $info['id'])
->orWhere('gl_project_deploy_build.dept_id', $info['belong_group'])
->orWhere('gl_project_deploy_optimize.design_mid', $info['id']);
// 处理 dept_id 条件
if (in_array($info['belong_group'], [7, 9])) {
// 7, 9 代表合并组 H + F 组
$subQuery->orWhere(function ($innerQuery) {
$innerQuery->where('gl_project_deploy_build.dept_id', 7)
->orWhere('gl_project_deploy_build.dept_id', 9);
});
} else {
$subQuery->orWhere('gl_project_deploy_build.dept_id', $info['belong_group'])
->orWhere('gl_project_deploy_optimize.dept_id', $info['belong_group']);
}
});
}
return $query;
... ...
... ... @@ -62,7 +62,11 @@ class RenewProjectController extends BaseController
}
//按类型搜索
$map['delete_status'] = 0;
if(empty($param['type'])){
$map['type'] = ['in',[2,3,4]];
}else{
$map['type'] = $param['type'];
}
$map['remain_day'] = ['<=',15];
return $map;
}
... ...
... ... @@ -67,7 +67,7 @@ class CNoticeController extends BaseController
}
$lang_num = count($this->param['language']);
$keyword_num = (new Keyword())->counts(['route'=>['!=',null]]);
$data_num = $this->productNum() + $this->CustomNum() + $this->newsNum() + $this->blogNum();
$data_num = $this->productNum() + $this->customNum() + $this->newsNum() + $this->blogNum();
$number = $keyword_num * 18 + $lang_num * $data_num;
if($number >= 450000){
$this->response('success',Code::SUCCESS,['msg'=>'翻译数量过多, 大概页面数量:'.$number.', 磁盘空间占用可能会超过40G,请联系管理员操作!']);
... ... @@ -179,7 +179,7 @@ class CNoticeController extends BaseController
* @method :post
* @time :2025/1/4 11:21
*/
public function CustomNum(){
public function customNum(){
$contentModel = new CustomModuleContent();
$number = $contentModel->counts(['status'=>0]);
$settingModel = new SettingNum();
... ... @@ -263,10 +263,10 @@ class CNoticeController extends BaseController
$domain_array = parse_url($domain);
$host = $domain_array['host'] ?? $domain_array['path'];
$host_array = explode('.',$host);
if($host_array[0] == 'www'){
if (count($host_array) <= 2) {
array_unshift($host_array, 'm');
} else {
$host_array[0] = 'm';
}else{
array_unshift($host_array,'m');
}
$domain = implode('.',$host_array);
}
... ...
... ... @@ -50,7 +50,8 @@ class ExtensionModuleController extends BaseController
'4'=>'文件框',
'5'=>'下拉框',
'6'=>'自动生成订单框',
'7'=>'创建时间'
'7'=>'创建时间',
'8'=>'多级联动框'
];
$this->response('success',Code::SUCCESS,$data);
}
... ... @@ -78,10 +79,10 @@ class ExtensionModuleController extends BaseController
if($info !== false){
$v['is_use'] = 1;
}
$list[$k] = $v;
if(!empty($v['data'])){
$v['data'] = json_decode($v['data'],true);
}
$list[$k] = $v;
}
$this->response('success',Code::SUCCESS,$list);
}
... ...
... ... @@ -193,10 +193,10 @@ class DomainInfoLogic extends BaseLogic
$domain_array = parse_url($info['domain']);
$host = $domain_array['host'] ?? $domain_array['path'];
$host_array = explode('.',$host);
if($host_array[0] == 'www'){
if (count($host_array) <= 2) {
array_unshift($host_array, 'm');
} else {
$host_array[0] = 'm';
}else{
array_unshift($host_array,'m');
}
$amp_domain = implode('.',$host_array);
if(!check_domain_record($amp_domain, $serversIpInfo)){
... ...
... ... @@ -102,6 +102,7 @@ class ProjectLogic extends BaseLogic
$info['minor_languages'] = $this->getProjectMinorLanguages($id);
//升级项目采集完成时间
$info['collect_time'] = $info['is_upgrade'] ? UpdateLog::getProjectUpdate($id) : '';
return $this->success($info);
}
... ... @@ -754,7 +755,7 @@ class ProjectLogic extends BaseLogic
* @time :2023/11/8 14:23
*/
public function copyProject(){
CopyProjectJob::dispatch(['project_id'=>$this->param['project_id']]);
NoticeLog::createLog(NoticeLog::TYPE_COPY_PROJECT, ['project_id' => $this->param['project_id']]);
return $this->success('项目复制中,请稍后前往初始化项目查看;');
}
... ... @@ -785,7 +786,9 @@ class ProjectLogic extends BaseLogic
public function saveOtherProject(){
//获取当前数据详情
$projectInfo = $this->getProjectInfo($this->param['id']);
//aicc if (($projectInfo['aicc'] == Project::TYPE_ZERO) && ($this->param['aicc'] == Project::TYPE_ONE)) 从关闭到开启状态才同步, 改成只要是开启状态就同步
if(($projectInfo['created_at'] >= '2014-12-01 00:00:00')){//12月1号过后默认不开启
$this->param['aicc'] = Project::TYPE_ZERO;
}
if($this->param['aicc'] == Project::TYPE_ONE && !empty($this->param['exclusive_aicc_day'])){
$data = [
'company_name'=>$projectInfo['company'],
... ...
... ... @@ -426,6 +426,8 @@ class ProductLogic extends BaseLogic
public function productDelete(){
DB::connection('custom_mysql')->beginTransaction();
try {
$columnModel = new Column();
$detailModel = new Detail();
$cateRelate = new CategoryRelated();
//删除扩展字段
$extendInfoModel = new ExtendInfo();
... ... @@ -441,6 +443,9 @@ class ProductLogic extends BaseLogic
//删除关联表
$cateRelate->del(['product_id'=>$id]);
$extendInfoModel->del(['product_id'=>$id]);
//删除描述
$columnModel->del(['product_id'=>$id]);
$detailModel->del(['product_id'=>$id]);
}else{
$this->delRoute($id);
//回收站
... ... @@ -692,7 +697,7 @@ class ProductLogic extends BaseLogic
'attrs'=>Arr::a2s($info['attrs']),
'attr_id'=>Arr::arrToSet($info['attr_id']),
'category_id'=>!empty($info['category_id']) ? ','.Arr::arrToSet($info['category_id']).',' : '',
'keyword_id'=>'',
'keyword_id'=> '',
'intro'=>$info['intro'],
'content'=>$info['content'],
'describe'=>Arr::a2s($info['describe']),
... ... @@ -973,31 +978,41 @@ class ProductLogic extends BaseLogic
}
//处理描述切换栏
$describe = [];
for ($i=11;$i<=20;$i+=2){
if(($data[$i]??'') && ($data[$i+1]??'')){
preg_match_all('/<img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $data[$i+1], $result_desc);
if($data[11]??''){
$attr_desc = json_decode($data[11],true);
if(is_array($attr_desc)){
foreach ($attr_desc as $vd){
$desc_title = $vd['title'];
if(empty($desc_title)){
continue;
}
$desc_text = $vd['text'];
if($desc_text){
preg_match_all('/<img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $desc_text, $result_desc);
if($result_desc[2]??[]){
foreach ($result_desc[2] as $vdesc_img){
$new_vdesc_img = check_remote_url_down($vdesc_img,$project_id,$domain,1);
$new_vdesc_img && $data[$i+1] = str_replace($vdesc_img,$new_vdesc_img,$data[$i+1]);
$new_vdesc_img && $desc_text = str_replace($vdesc_img,$new_vdesc_img,$desc_text);
}
}
preg_match_all('/<source\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $data[$i+1], $result_desc_video);
preg_match_all('/<source\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $desc_text, $result_desc_video);
if($result_desc_video[2]??[]){
foreach ($result_desc_video[2] as $vdesc_video){
$new_vdesc_video = check_remote_url_down($vdesc_video,$project_id,$domain,1);
$new_vdesc_video && $data[$i+1] = str_replace($vdesc_video,$new_vdesc_video,$data[$i+1]);
$new_vdesc_video && $desc_text = str_replace($vdesc_video,$new_vdesc_video,$desc_text);
}
}
}
$describe[] = [
'title' => $data[$i],
'text' => $data[$i+1],
'title' => $desc_title,
'text' => $desc_text
];
}else{
break;
}
}
}
$id = $this->model->addReturnId(
[
'project_id' => $project_id,
... ... @@ -1062,8 +1077,8 @@ class ProductLogic extends BaseLogic
$cModel = new Column();
$c_id = $cModel->addReturnId(['column_name'=>$describe_value['title'],'product_id'=>$id]);
$dataS = [
'product_id'=>$c_id,
'column_id'=>$id,
'product_id'=>$id,
'column_id'=>$c_id,
'text_type'=>1,
'title'=>$describe_value['title'] ?? '',
'sort'=>$describe_key + 1,
... ...
... ... @@ -77,7 +77,7 @@ class TranslateLogic extends BaseLogic
if($val == ' ' || $val == ''){
continue;
}
$val = str_replace(' ','',urldecode($val));//处理特殊字符
$val = str_replace(' ','',$val);//处理特殊字符
$val = trim(str_replace(' ','',$val));
if (FALSE == in_array($val, $old_key)){
$arr2[] = $val;
... ...
... ... @@ -13,6 +13,7 @@ class NoticeLog extends Base
const TYPE_PROJECT = 'project';
const TYPE_RANK_DATA = 'rank_data';
const TYPE_INIT_PROJECT = 'init_project';
const TYPE_COPY_PROJECT = 'copy_project';
const TYPE_INIT_KEYWORD = 'init_keyword';
const DELETE_PRODUCT_CATEGORY = 'delete_product_category';
const DELETE_BLOG_CATEGORY = 'delete_blog_category';
... ...
... ... @@ -379,6 +379,12 @@ class Project extends Base
//是否正式域名
if (!$project_id) {
$domainModel = new DomainInfoModel();
//M站特殊域名处理
if($domain == 'm.sinophorus.com'){
$domain = 'en.sinophorus.com';
}
$project_id = $domainModel->formatQuery(['domain'=>$domain,'status'=>1])->value('project_id');
if (empty($project_id)) {
//是否小语种域名或amp站域名
... ...
... ... @@ -418,10 +418,10 @@ class BtRepository
$domain_array = parse_url($domain);
$host = $domain_array['host'] ?? $domain_array['path'];
$host_array = explode('.',$host);
if($host_array[0] == 'www'){
if (count($host_array) <= 2) {
array_unshift($host_array, 'm');
} else {
$host_array[0] = 'm';
}else{
array_unshift($host_array,'m');
}
$host = implode('.',$host_array);
... ...