作者 Your Name
... ... @@ -92,8 +92,6 @@ class HtmlCollect extends Command
try {
$html = curl_c('https://' . $collect_info->domain . $collect_info->route, false);
if (strlen($html) < 4) {
$collect_info->status = CollectTask::STATUS_FAIL;
$collect_info->save();
if ($html == 404) {
//原数据页面404,需要将6.0数据存入草稿箱
... ... @@ -124,6 +122,8 @@ class HtmlCollect extends Command
$status_draft = BCustomTemplate::STATUS_DRAFT;
}
$model->edit(['status' => $status_draft], ['project_id' => $project_id, 'id' => $collect_info->source_id, 'six_read' => 1]);
CollectTask::where('source', $collect_info->source)->where('source_id', $collect_info->source_id)->delete();
}
echo 'date:' . date('Y-m-d H:i:s') . ', project_id: ' . $project_id . ', collect_id: ' . $collect_id . ', error: ' . $html . PHP_EOL;
... ... @@ -347,6 +347,14 @@ class HtmlCollect extends Command
$source[] = $check_vv2;
}
}
preg_match_all('/<iframe\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $html, $result_video_3);
$video_3 = $result_video_3[2] ?? [];
foreach ($video_3 as $vv3) {
$check_vv3 = $this->url_check($vv3, $project_id, $domain, $web_url_domain, $home_url);
if ($check_vv3 && (!in_array($check_vv3, $source))) {
$source[] = $check_vv3;
}
}
//css
preg_match_all('/<link\s+[^>]*?href\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $html, $result_css);
... ...
... ... @@ -28,6 +28,7 @@ class ServersController extends BaseController
if(isset($this->map['server_name']) && !empty($this->map['server_name'])){
$this->map['server_name'] = ['like','%'.$this->map['server_name'].'%'];
}
$this->map['status'] = 0;
$serversModel = new ServersModel();
$lists = $serversModel->list($this->map);
$this->response('success',Code::SUCCESS,$lists);
... ...
... ... @@ -121,4 +121,21 @@ class ATemplateModuleController extends BaseController
$list = $project->list($this->map,'id',['id','title']);
$this->response('success',Code::SUCCESS,$list);
}
/**
* @remark :修改审核状态
* @name :auditingStatus
* @author :lyh
* @method :post
* @time :2024/5/23 16:42
*/
public function auditingStatus(ATemplateModuleLogic $ATemplateModuleLogic){
$this->request->validate([
'id'=>'required'
],[
'id.required' => 'ID不能为空'
]);
$data = $ATemplateModuleLogic->auditingStatus();
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -100,4 +100,19 @@ class ATemplateModuleLogic extends BaseLogic
return $this->success();
}
/**
* @remark :修改状态
* @name :auditingStatus
* @author :lyh
* @method :post
* @time :2024/5/23 16:44
*/
public function auditingStatus(){
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
if($rs === false){
$this->fail('修改失败,请联系管理员');
}
return $this->success(['id'=>$this->param['id']]);
}
}
... ...
... ... @@ -203,7 +203,7 @@ class BlogLogic extends BaseLogic
public function getCategory($category){
$str = '';
foreach ($category as $v){
$str .= $v.',';
$str .= $v.',';
}
return !empty(trim($str,',')) ? ','.$str.',' : '';
}
... ...
... ... @@ -59,32 +59,23 @@ class NewsLogic extends BaseLogic
*/
public function newsSave()
{
//拼接参数
// DB::beginTransaction();
// try {
$this->param = $this->paramProcessing($this->param);
if (isset($this->param['id']) && !empty($this->param['id'])) {
$id = $this->param['id'];
$is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
$six_read = $this->param['six_read'] ?? 0;//是否按6.0显示
if($is_upgrade == 0 || $six_read == 1) {
$this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']);
}
//是否更新路由
$route = $this->param['url'];
$this->edit($this->param, ['id' => $id]);
} else {
$this->param['sort'] = $this->setNewsSort();
$id = $this->model->addReturnId($this->param);
$route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']);
$this->edit(['url' => $route], ['id' => $id]);
$this->param = $this->paramProcessing($this->param);
if (isset($this->param['id']) && !empty($this->param['id'])) {
$id = $this->param['id'];
$is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
$six_read = $this->param['six_read'] ?? 0;//是否按6.0显示
if($is_upgrade == 0 || $six_read == 1) {
$this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']);
}
// //更新路由
// DB::commit();
// } catch (\Exception $e) {
// DB::rollBack();
// $this->fail('系统错误,请联系管理员');
// }
//是否更新路由
$route = $this->param['url'];
$this->edit($this->param, ['id' => $id]);
} else {
$this->param['sort'] = $this->setNewsSort();
$id = $this->model->addReturnId($this->param);
$route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']);
$this->edit(['url' => $route], ['id' => $id]);
}
$this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route);
$this->curlDelRoute(['new_route'=>$route]);
return $this->success(['id'=>$id]);
... ... @@ -223,10 +214,10 @@ class NewsLogic extends BaseLogic
*/
public function getCategory($category){
$str = '';
if(is_array($category) && $category){
$str = ','.implode(',',$category).',';
foreach ($category as $v){
$str .= $v.',';
}
return $str;
return !empty(trim($str,',')) ? ','.$str.',' : '';
}
/**
... ...
... ... @@ -373,6 +373,7 @@ Route::middleware(['aloginauth'])->group(function () {
Route::any('/status', [Aside\Template\ATemplateModuleController::class, 'status'])->name('admin.ATemplateModule_status');
Route::any('/del', [Aside\Template\ATemplateModuleController::class, 'del'])->name('admin.ATemplateModule_del');
Route::any('/type', [Aside\Template\ATemplateModuleController::class, 'getType'])->name('admin.ATemplateModule_getType');
Route::any('/auditingStatus', [Aside\Template\ATemplateModuleController::class, 'auditingStatus'])->name('admin.ATemplateModule_auditingStatus');
Route::any('/getProjectList', [Aside\Template\ATemplateModuleController::class, 'getProjectList'])->name('admin.ATemplateModule_getProjectList');
});
//设置类型
... ...