作者 张关杰

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

... ... @@ -262,33 +262,48 @@ class Demo extends Command
//
// print_r($include);
// }
public function handle(){
$projectModel = new DeployOptimize();
$list = $projectModel->list();
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'end'.json_encode($v) . PHP_EOL;
$data = [];
if(!empty($v['minor_languages'])){
foreach ($v['minor_languages'] as $k1=> $v1){
if(!empty($v1['tl']) && !empty($v1['type'])){
$data[] = [
'language'=>$v1['tl'],
'type'=>$v1['type'],
'keywords'=>$v1['keywords'],
'service_day'=>$v1['service_day'],
'project_id'=>$v['project_id'],
'created_at'=>date('Y-m-d H:i:s'),
'updated_at'=>date('Y-m-d H:i:s')
];
}
$projectModel = new Project();
$list = $projectModel->list(['type'=>['in',[2,3]]]);
foreach ($list as $k => $v){
$domainModel = new DomainInfo();
if(!empty($v['uptime'])){
//获取项目域名的时间
$domainInfo = $domainModel->read(['project_id'=>$v['id']]);
if($domainInfo !== false){
// dd($domainInfo);
$projectModel->edit(['uptime'=>$domainInfo['created_at']],['id'=>$v['id']]);
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
}
}
$languageModel = new MinorLanguages();
$languageModel->insert($data);
}
}
// public function handle(){
// $projectModel = new DeployOptimize();
// $list = $projectModel->list(['project_id'=>['<',187]]);
// foreach ($list as $v){
// echo date('Y-m-d H:i:s') . 'end'.json_encode($v) . PHP_EOL;
// $data = [];
// if(!empty($v['minor_languages']) && is_array($v['minor_languages'])){
// foreach ($v['minor_languages'] as $k1=> $v1){
// if(!empty($v1['tl']) && !empty($v1['type'])){
// $data[] = [
// 'language'=>$v1['tl'],
// 'type'=>$v1['type'],
// 'keywords'=>$v1['keywords'],
// 'service_day'=>$v1['service_day'],
// 'project_id'=>$v['project_id'],
// 'created_at'=>date('Y-m-d H:i:s'),
// 'updated_at'=>date('Y-m-d H:i:s')
// ];
// }
// }
// }
// $languageModel = new MinorLanguages();
// $languageModel->insert($data);
// }
//
// }
public function printMessage()
{
... ...
... ... @@ -55,7 +55,7 @@ class UpdateRoute extends Command
*/
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['id'=>672]);
$list = $projectModel->list(['id'=>917]);
$data = [];
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
... ...
... ... @@ -540,6 +540,7 @@ class ProductController extends BaseController
'keyword.required' => 'keyword不能为空',
]);
$data = http_get('http://title.globalso.com/ajax_data_for_web.php?keyword='.$this->param['keyword'],['charset=utf-8']);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($data, true) . PHP_EOL, FILE_APPEND);
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -132,8 +132,8 @@ class ProjectLogic extends BaseLogic
* @time :2023/8/30 11:57
*/
public function projectSave(){
// DB::beginTransaction();
// try {
DB::beginTransaction();
try {
$this->param['project_location'] = 0;//TODO::图片文件存储不同地方,上线后删除
if($this->param['type'] == Project::TYPE_SEVEN){
//错误单直接返回,单独处理
... ... @@ -151,20 +151,15 @@ class ProjectLogic extends BaseLogic
$this->saveProjectDeployOptimize($this->param['deploy_optimize']);
//保存售后信息
$this->saveProjectAfter($this->param['project_after']);
$this->saveMinorLanguages($this->param['minor_language'] ?? []);
//保存询盘过滤配置
// $this->param['inquiry_filter_config']['project_id'] = $this->param['id'];
// $this->saveInquiryFilterConfig($this->param['inquiry_filter_config']);
$this->syncImageFile($this->param['project_location'],$this->param['id']);
//创建站点
// $this->createSite($this->param);
(new SyncService())->projectAcceptAddress($this->param['id']);
// }
// DB::commit();
// }catch (\Exception $e){
// DB::rollBack();
// $this->fail('保存失败,请联系管理员');
}
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('保存失败,请联系管理员');
}
return $this->success();
... ... @@ -189,6 +184,9 @@ class ProjectLogic extends BaseLogic
$param['extend_type'] = Project::TYPE_FIVE;
unset($param['type']);
}
if((($param['type'] == Project::TYPE_TWO) || ($param['type'] == Project::TYPE_THREE)) && empty($param['uptime'])){
$param['uptime'] = date('Y-m-d H:i:s');
}
if(isset($param['level']) && !empty($param['level'])){
$param['level'] = Arr::arrToSet($param['level']);
}
... ... @@ -228,6 +226,7 @@ class ProjectLogic extends BaseLogic
$param['is_visualization'] = json_encode($param['is_visualization']);
}
}
$this->model->edit($param,['id'=>$param['id']]);
Common::del_user_cache($this->model->getTable(),$param['id']);
return $this->success();
... ...
... ... @@ -58,7 +58,7 @@ class RatingLogic extends BaseLogic
'type'=>$this->param['type']
];
$this->scoringModel->add($param);
return $this->httpSore($this->param['data'],$this->project['post_id'],$this->param['type']);
return $this->httpSore($this->param['data'],$this->project['id'],$this->param['type']);
}
/**
... ...
... ... @@ -30,7 +30,7 @@ class DomainInfo extends Base
const DELETED_DELETE = 1;
protected $hidden = [
'created_at',
// 'created_at',
'updated_at'
];
... ...
... ... @@ -48,7 +48,7 @@ class ProjectUpdateTdk extends Base
$project_id = Redis::rpop('updateSeoTdk');
$data = [];
if($project_id){
$data = self::find($project_id);
$data = self::where('status', self::STATUS_PENDING)->where('project_id', $project_id)->orderBy('id', 'asc')->first();
}
if($data){
return $data;
... ...
... ... @@ -55,9 +55,10 @@ class RouteMap extends Base
public static function generateRoute($title, $source, $source_id, $project_id){
if(preg_match('/[\x{4e00}-\x{9fa5}]/u', $title)){
$title = Translate::tran($title, 'en');
}
if (preg_match('/[а-яА-Я]/u', $title) || mb_ereg('[а-яА-Я]', $title)) {
$title = Translate::tran($title, 'en');
}else{
if(!preg_match('/^[a-zA-Z\s]+$/', $title)){
$title = Translate::tran($title, 'en');
}
}
$i=1;
$sign = generateRoute($title);
... ...