作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

... ... @@ -62,11 +62,11 @@ class UpdateBuildConfiguration extends Command
*/
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['delete_status'=>0,'id'=>['in',[1718]]],'id',['id'],'asc');
$list = $projectModel->list(['delete_status'=>0,'id'=>3050],'id',['id'],'asc');
foreach ($list as $k => $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
$this->getProduct();
$this->getProduct($v['id']);
DB::disconnect('custom_mysql');
}
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
... ... @@ -79,7 +79,14 @@ class UpdateBuildConfiguration extends Command
* @method :post
* @time :2024/12/11 14:40
*/
public function getProduct(){
public function getProduct($project_id){
// $productModel = new Product();
// $product_list = $productModel->formatQuery(['status'=>1,'content'=>['!=',null]])->count();
// $detailModel = new Detail();
// $lists = $detailModel->count();
// if(($product_list > 0) && ($lists == 0)){
// echo date('Y-m-d H:i:s') . '需要处理的项目:'.$project_id . PHP_EOL;
// }
Detail::truncate();
Column::truncate();
$c = new Column();
... ...
... ... @@ -199,11 +199,15 @@ class ProjectController extends BaseController
* @return mixed
*/
public function searchContent(&$query){
if(!empty($this->map['domain'])){
$parsedUrl = parse_url($this->map['domain']);
$domain = $parsedUrl['host'] ?? $this->map['domain'];
$ids = DomainInfo::where('domain', 'like', '%'.$domain.'%')->pluck('id')->toArray();
if(!empty($this->map['domain_type']) && !empty($this->map['domain_search'])){
if($this->map['domain_type'] == 'domain'){
$parsedUrl = parse_url($this->map['domain_search']);
$this->map['domain_search'] = $parsedUrl['host'] ?? $this->map['domain_search'];
$ids = DomainInfo::where('domain', 'like', '%'.$this->map['domain_search'].'%')->pluck('id')->toArray();
$query->whereIn('gl_project_deploy_optimize.domain', $ids);
}else{
$query->where('gl_project_deploy_build.test_domain','like','%'.$this->map['domain_search'].'%');
}
}
if(!empty($this->map['search']) && !empty($this->map['search_type'])){
$query->where(function ($subQuery) {
... ...
... ... @@ -550,18 +550,33 @@ class ProductLogic extends BaseLogic
public function copyColumn($product_id,$new_product_id){
$columnModel = new Column();
$columnList = $columnModel->list(['product_id'=>$product_id]);
if(!empty($columnInfo)){
$data = [];
if(!empty($columnList)){
foreach ($columnList as $k => $v){
$column_id = $v['id'];
unset($v['id']);
$v['product_id'] = $new_product_id;
$v['created_at'] = date('Y-m-d H:i:s');
$v['updated_at'] = date('Y-m-d H:i:s');
$data[] = $v;
$column_news_id = $columnModel->addReturnId($v);
//执行新增描述
$detailModel = new Detail();
$detailList = $detailModel->list(['product_id'=>$product_id,'column_id'=>$column_id]);
if(!empty($detailList)){
$data = [];
foreach ($detailList as $val){
unset($val['id']);
$val['css'] = Arr::a2s($val['css']);
$val['content'] = Arr::a2s($val['content']);
$val['product_id'] = $new_product_id;
$val['column_id'] = $column_news_id;
$val['created_at'] = date('Y-m-d H:i:s');
$val['updated_at'] = date('Y-m-d H:i:s');
$data[] = $val;
}
$detailModel->insert($data);
}
return $columnModel->insert($data);
}
}
return $this->success();
}
/**
* @remark :复制描述
... ... @@ -572,8 +587,8 @@ class ProductLogic extends BaseLogic
*/
public function copyDetail($product_id,$new_product_id){
$detailModel = new Detail();
$detailList = $detailModel->list(['product_id'=>$product_id]);
if(!empty($columnInfo)){
$detailList = $detailModel->list(['product_id'=>$product_id,'column_id'=>1]);
if(!empty($detailList)){
$data = [];
foreach ($detailList as $k => $v){
unset($v['id']);
... ... @@ -587,7 +602,6 @@ class ProductLogic extends BaseLogic
return $detailModel->insert($data);
}
}
/**
* @remark :复制项目扩展字段
* @name :copyExtendInfo
... ...
... ... @@ -280,7 +280,7 @@ class TranslateLogic extends BaseLogic
try {
$info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'project_id'=>$this->user['project_id'],'type'=>$this->param['type']]);
if($info === false){
$sourceInfo = $this->getRouteSource($this->param['url']);
$sourceInfo = $this->getRouteSource($sendData['new_route']);
$param = [
'type'=>$this->param['type'] ?? 1,
'project_id'=>$this->user['project_id'],
... ... @@ -291,7 +291,7 @@ class TranslateLogic extends BaseLogic
'source_id'=>$sourceInfo['source_id'],
'is_list'=>$sourceInfo['is_list'],
'is_custom'=>$sourceInfo['is_custom'],
'page'=>$sourceInfo['page'] ?? 0
'page'=>$sendData['page'] ?? 0
];
$id = $this->model->addReturnId($param);
TranslateData::insert(['trans_id'=>$id,'data'=>json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)]);
... ... @@ -331,7 +331,7 @@ class TranslateLogic extends BaseLogic
$page = 0;
if (is_numeric($route)) {
$arr = explode('/',$routes);
$page = $arr[1];
$page = $route;
$route = $arr[0];
}
$routeModel = new RouteMap();
... ...