作者 刘锟

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

正在显示 34 个修改的文件 包含 251 行增加109 行删除
... ... @@ -63,7 +63,7 @@ class DeleteBlogCategory extends Command
$noticeLogModel = new NoticeLog();
$list = $noticeLogModel->list(['status'=>NoticeLog::STATUS_PENDING,'type'=>NoticeLog::DELETE_BLOG_CATEGORY],'id',['*'],'asc',100);
if(empty($list)){
sleep(100);
sleep(10);
continue;
}
foreach ($list as $item){
... ...
... ... @@ -63,7 +63,7 @@ class DeleteCustomCategory extends Command
$noticeLogModel = new NoticeLog();
$list = $noticeLogModel->list(['status'=>NoticeLog::STATUS_PENDING,'type'=>NoticeLog::DELETE_CUSTOM_CATEGORY],'id',['*'],'asc',100);
if(empty($list)){
sleep(100);
sleep(10);
continue;
}
foreach ($list as $item){
... ...
... ... @@ -63,7 +63,7 @@ class DeleteNewsCategory extends Command
$noticeLogModel = new NoticeLog();
$list = $noticeLogModel->list(['status'=>NoticeLog::STATUS_PENDING,'type'=>NoticeLog::DELETE_NEWS_CATEGORY],'id',['*'],'asc',100);
if(empty($list)){
sleep(100);
sleep(10);
continue;
}
foreach ($list as $item){
... ...
... ... @@ -64,7 +64,7 @@ class DeleteProductCategory extends Command
$noticeLogModel = new NoticeLog();
$list = $noticeLogModel->list(['status'=>NoticeLog::STATUS_PENDING,'type'=>NoticeLog::DELETE_PRODUCT_CATEGORY],'id',['*'],'asc',100);
if(empty($list)){
sleep(100);
sleep(10);
continue;
}
foreach ($list as $item){
... ...
... ... @@ -119,14 +119,18 @@ class VideoTask extends Command
'updated_at' => date('Y-m-d H:i:s'),
'created_at' => date('Y-m-d H:i:s'),
];
KeywordVideoTaskLog::insert($array);
$num--;
$sub_task_num--;
$rs = KeywordVideoTaskLog::insert($array);
if($rs){
$num--;
$sub_task_num--;
}
}
}
if($sub_task_num != 0){
$task_project->num = 0;
$task_project->status = KeywordVideoTask::STATUS_CLOSE;
$task_project->num = $num;
if($num == 0){
$task_project->status = KeywordVideoTask::STATUS_CLOSE;
}
$task_project->save();
}
}
... ... @@ -184,10 +188,11 @@ class VideoTask extends Command
if(count($keyword_arr_id) == 0){
return [];
}
if(count($keyword_arr_id) < $number){
$number = count($keyword_arr_id);
if(count($keyword_arr_id) <= $number){
$keyword_id = array_rand($keyword_arr_id, count($keyword_arr_id));
}else{
$keyword_id = array_rand($keyword_arr_id, $number);
}
$keyword_id = array_rand($keyword_arr_id, $number);
$keyword = Keyword::whereIn("id", $keyword_id)->get();
return $keyword;
}
... ...
... ... @@ -63,7 +63,7 @@ class ReplaceHtml extends Command
$replaceHtmlModel = new TemplateReplaceHtml();
$replaceHtmlList = $replaceHtmlModel->list(['status'=>$replaceHtmlModel::STATUS]);
if(empty($replaceHtmlList)){
sleep(100);
sleep(20);
continue;
}
foreach ($replaceHtmlList as $v){
... ... @@ -79,7 +79,7 @@ class ReplaceHtml extends Command
echo '结束'.PHP_EOL;
DB::disconnect('custom_mysql');
}
sleep(50);
sleep(10);
return true;
}
}
... ... @@ -131,6 +131,7 @@ class ReplaceHtml extends Command
$templateHtmlLogModel = new TemplateReplaceHtmlLog();
$list = $templateHtmlLogModel->list(['replace_id'=>$info['rollback_id']]);
foreach ($list as $value){
unset($value['id']);
$value['replace_id'] = $info['id'];
$value['is_rollback'] = $info['is_rollback'];
$value['old_html'] = $info['old_html'];
... ... @@ -155,7 +156,9 @@ class ReplaceHtml extends Command
foreach ($bTemplateList as $v){
$source_id = $v['source'] == 1 ? 0 : $v['source_id'];
$name_route = $this->getSourceName($v['source'],$source_id,$v['is_list'],$v['is_custom']);
$saveData[] = $this->saveData($info,$v,$source_id,$name_route);
if($name_route !== false){
$saveData[] = $this->saveData($info,$v,$source_id,$name_route);
}
}
}
if(!empty($saveData)){
... ... @@ -204,7 +207,7 @@ class ReplaceHtml extends Command
return $this->getCustomName($source,$source_id,$is_list);
}
if($source == BTemplate::SOURCE_HOME){
return '';
return ['name'=>'','route'=>''];;
}elseif ($source == BTemplate::SOURCE_PRODUCT){
return $this->getProductName($source_id,$is_list);
}elseif ($source == BTemplate::SOURCE_BLOG){
... ...
... ... @@ -42,27 +42,27 @@ class Demo extends Command
{
$this->param['project_id'] = 181;
$imageModel = new ImageModel();
// //获取当前项目的所有图片
// $imageList = $imageModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos','size']);
// if(!empty($imageList)){
// $amazonS3Service = new AmazonS3Service();
// foreach ($imageList as $k => $v){
// $amazonS3Service->syncImageFiles(getImageUrl($v['path']));
// $imageModel->edit(['is_cos'=>0],['id'=>$v['id']]);
// }
// }
$fileModel = new FileModel();
$fileList = $fileModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos','name']);
if(!empty($fileList)){
//获取当前项目的所有图片
$imageList = $imageModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos','size']);
if(!empty($imageList)){
$amazonS3Service = new AmazonS3Service();
foreach ($fileList as $k => $v){
echo date('Y-m-d H:i:s') . '执行的数据id:' . $v['id'] . '名称:'.$v['name'] . PHP_EOL;
$amazonS3Service->syncImageFiles(getFileUrl($v['path']));
$fileModel->edit(['is_cos'=>0],['id'=>$v['id']]);
gc_collect_cycles();
foreach ($imageList as $k => $v){
$amazonS3Service->syncImageFiles(getImageUrl($v['path']));
$imageModel->edit(['is_cos'=>0],['id'=>$v['id']]);
}
}
// $fileModel = new FileModel();
// $fileList = $fileModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos','name']);
// if(!empty($fileList)){
// $amazonS3Service = new AmazonS3Service();
// foreach ($fileList as $k => $v){
// echo date('Y-m-d H:i:s') . '执行的数据id:' . $v['id'] . '名称:'.$v['name'] . PHP_EOL;
// $amazonS3Service->syncImageFiles(getFileUrl($v['path']));
// $fileModel->edit(['is_cos'=>0],['id'=>$v['id']]);
// gc_collect_cycles();
// }
// }
return true;
}
... ...
... ... @@ -39,7 +39,6 @@ class CustomModuleController extends BaseController
$this->response('success');
}
$customModule = new CustomModule();
$this->map['status'] = 0;
$lists = $customModule->lists($this->map,$this->page,$this->row,$this->order = ['topping_time','sort','id']);
DB::disconnect('custom_mysql');
$this->response('success',Code::SUCCESS,$lists);
... ...
... ... @@ -245,4 +245,20 @@ class ATemplateController extends BaseController
$this->response('success',Code::SUCCESS,$lists);
}
/**
* @remark :修改审核状态
* @name :auditingStatus
* @author :lyh
* @method :post
* @time :2024/5/23 16:42
*/
public function auditingStatus(ATemplateLogic $aTemplateLogic){
$this->request->validate([
'id'=>'required'
],[
'id.required' => 'ID不能为空'
]);
$data = $aTemplateLogic->auditingStatus();
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -25,9 +25,6 @@ class ATemplateModuleController extends BaseController
* @time :2023/6/28 16:54
*/
public function lists(ATemplateModuleLogic $ATemplateModuleLogic){
if(isset($this->map['type']) && ($this->map['type'] == 99)){
$this->map['type'] = 99;
}
$lists = $ATemplateModuleLogic->aTemplateModuleLists($this->map,$this->page,$this->row,$this->order);
$this->response('success',Code::SUCCESS,$lists);
}
... ...
... ... @@ -13,6 +13,7 @@ use App\Enums\Common\Code;
use App\Http\Controllers\Aside\BaseController;
use App\Http\Logic\Aside\Template\ReplaceHtmlLogic;
use App\Models\Manage\Manage;
use App\Models\Project\DeployBuild;
use App\Models\Project\Project;
use App\Models\Template\TemplateReplaceHtml;
use App\Models\Template\TemplateReplaceHtmlLog;
... ... @@ -71,7 +72,7 @@ class ReplaceHtmlController extends BaseController
foreach ($lists['list'] as $k => $v){
$v['project_name'] = (new Project())->getProjectName($v['project_id']);
$v['operator_name'] = (new Manage())->getName($v['operator_id']);
$v['source_name'] = $logic->getSourceName($v['source'],$v['is_list'],$v['is_custom'],$v['project_id']);
$v['page_name'] = $logic->getSourceName($v['source'],$v['is_list'],$v['is_custom'],$v['project_id']);
$lists['list'][$k] = $v;
}
}
... ... @@ -92,6 +93,19 @@ class ReplaceHtmlController extends BaseController
'replace_id.required' => '主id不能为空',
]);
$lists = $replaceHtmlLog->lists($this->map,$this->page,$this->row,$this->order);
$projectModel = new DeployBuild();
$domain = '';
if(!empty($lists) && !empty($lists['list'])){
foreach ($lists['list'] as $k => $v){
if($k == 0){
$projectInfo = $projectModel->read(['project_id'=>$v['project_id']]);
$domain = $projectInfo['test_domain'];
}
$v['page_name'] = $logic->getSourceName($v['source'],$v['is_list'],$v['is_custom'],$v['project_id']);
$v['route'] = $domain.$v['route'];
$lists['list'][$k] = $v;
}
}
$this->response('success',Code::SUCCESS,$lists);
}
... ...
... ... @@ -101,13 +101,6 @@ class ProjectUserController extends BaseController
*/
public function save(UserRequest $request,UserLogic $userLogic){
$request->validated();
if(!isset($this->param['id'])){
$this->request->validate([
'password'=>'required',
],[
'password.required' => '密码不能为空',
]);
}
$userLogic->projectUserSave();
$this->response('success');
}
... ...
... ... @@ -64,8 +64,16 @@ class FileManageController extends BaseController
* @time :2023/12/28 17:18
*/
public function downLoad(){
if(!isset($this->param['path']) || empty($this->param['path'])){
$this->response('参数错误',Code::SYSTEM_ERROR);
}
$username = basename($this->param['path']);
$fileUrl = 'https://file.globalso.com'.$this->param['path'];
$parsed_url = parse_url($this->param['path']);
if(isset($parsed_url['scheme'])){
$fileUrl = $this->param['path'];
} else {
$fileUrl = 'https://file.globalso.com'.$this->param['path'];
}
// 设置响应头
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
... ...
... ... @@ -8,6 +8,7 @@ use App\Http\Logic\Bside\BTemplate\BTemplateLogic;
use App\Http\Requests\Bside\Template\TemplateRequest;
use App\Models\Template\BTemplate;
use App\Models\Template\Setting;
use App\Models\Template\Template;
class BTemplateController extends BaseController
{
... ... @@ -159,15 +160,21 @@ class BTemplateController extends BaseController
}
/**
* @remark :获取source类型
* @name :getSource
* @remark :选择内页模版
* @name :setPublicTemplate
* @author :lyh
* @method :post
* @time :2024/1/3 9:06
* @time :2024/5/24 15:08
*/
public function getSource(){
$bTemplateModel = new BTemplate();
$info = $bTemplateModel->sourceMap();
$this->response('success',Code::SUCCESS,$info);
public function setPublicTemplate(BTemplateLogic $BTemplateLogic){
$this->request->validate([
'id'=>'required',
'template_id'=>'required',
],[
'id.required' => '当前数据id不能为空',
'template_id.required' => '模版id不能为空',
]);
$BTemplateLogic->setCustomTemplate();
$this->response('保存成功');
}
}
... ...
... ... @@ -42,7 +42,8 @@ class BTemplateLogController extends BaseController
$userModel = new User();
foreach ($lists['list'] as $k => $v){
if(!empty($v['template_id'])){
$v['template_name'] = $templateModel->read(['id'=>$v['template_id']],['name'])['name'];
$template_name = $templateModel->read(['id'=>$v['template_id']],['name']);
$v['template_name'] = $template_name !== false ? $templateModel['name'] : '';
}
$v['operator_name'] = $userModel->getName($v['operator_id']);
$lists['list'][$k] = $v;
... ...
... ... @@ -170,7 +170,7 @@ class CustomTemplateController extends BaseController
],[
'id.required' => 'ID不能为空',
]);
$logic->copyCustomTemplateInfo();
$this->response('success');
$data = $logic->copyCustomTemplateInfo();
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -347,7 +347,7 @@ class FileController
// 设置响应头
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $info['name'] . '"');
header('Content-Disposition: attachment; filename="' . !empty($info['name']) ? $info['name'] : '未命名'.basename($info['path']) . '"');
// 下载文件
readfile($fileUrl);
}
... ...
... ... @@ -290,9 +290,13 @@ class ImageController extends Controller
'name'=>$name,
'en_name'=>$fileName
];
$rs = $imageModel->add($data);
if ($rs === false) {
return $this->response('添加失败', Code::USER_ERROR);
$imageModel = new ImageModel();
$info = $imageModel->read(['hash'=>$hash,'project_id'=>$this->cache['project_id'] ?? 0]);
if($info === false){
$rs = $imageModel->add($data);
if ($rs === false) {
return $this->response('添加失败', Code::USER_ERROR);
}
}
return true;
}
... ...
... ... @@ -143,10 +143,6 @@ class HrLogic extends BaseLogic
$user->type = User::TYPE_ONE;
$user->role_id = 38; //技术总部
$user->save();
}else{
$user->mobile = $mobile;
$user->name = $name;
$user->save();
}
}else{
//离职
... ...
... ... @@ -131,9 +131,8 @@ class ProjectLogic extends BaseLogic
* @time :2023/8/30 11:57
*/
public function projectSave(){
DB::beginTransaction();
try {
// $this->param['project_location'] = 0;//TODO::图片文件存储不同地方,上线后删除
// DB::beginTransaction();
// try {
if($this->param['type'] == Project::TYPE_SEVEN){
//错误单直接返回,单独处理
$this->setTypeSevenEdit($this->param);
... ... @@ -154,11 +153,11 @@ class ProjectLogic extends BaseLogic
$this->syncImageFile($this->param['project_location'],$this->param['id']);
(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();
}
... ... @@ -177,16 +176,16 @@ class ProjectLogic extends BaseLogic
* @time :2023/8/30 12:14
*/
public function saveProject($param){
if($param['type'] == Project::TYPE_FIVE){
$param['extend_type'] = Project::TYPE_FIVE;
unset($param['type']);
}
if($param['type'] == Project::TYPE_ONE){
$param['serve_id'] = 9;
}
if((($param['type'] == Project::TYPE_TWO) || ($param['type'] == Project::TYPE_THREE)) && empty($param['uptime'])){
$param['uptime'] = date('Y-m-d H:i:s');
}
if($param['type'] == Project::TYPE_FIVE){
$param['extend_type'] = Project::TYPE_FIVE;
unset($param['type']);
}
if(isset($param['level']) && !empty($param['level'])){
$param['level'] = Arr::arrToSet($param['level']);
}
... ... @@ -679,7 +678,7 @@ class ProjectLogic extends BaseLogic
*/
public function copyProject(){
CopyProjectJob::dispatch(['project_id'=>$this->param['project_id']]);
return $this->success();
return $this->success('项目复制中,请稍后前往初始化项目查看;');
}
/**
... ...
... ... @@ -3,6 +3,7 @@
namespace App\Http\Logic\Aside\Template;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Manage\Manage;
use App\Models\RouteMap\RouteMap;
use App\Models\Service\Service as ServiceSettingModel;
use App\Models\Template\BTemplate;
... ... @@ -123,6 +124,12 @@ class ATemplateLogic extends BaseLogic
if(!empty($info['image'])){
$info['image_link'] = getImageUrl($info['image']);
}
if(!empty($info['design_manager'])){
$info['design_manager'] = (new Manage())->getName($info['design_manager']);
}
if(!empty($info['front_manager'])){
$info['front_manager'] = (new Manage())->getName($info['front_manager']);
}
return $this->success($info);
}
... ... @@ -244,4 +251,30 @@ class ATemplateLogic extends BaseLogic
}
return $this->success($data);
}
/**
* @remark :修改状态
* @name :auditingStatus
* @author :lyh
* @method :post
* @time :2024/5/23 16:44
*/
public function auditingStatus(){
//获取当前数据详情
$info = $this->model->read(['id'=>$this->param['id']]);
if(isset($this->param['front_status']) && $this->param['front_status'] == 1){
if($info['design_status'] == 0){
$this->fail('请先提交设计审核');
}
$this->param['design_manager'] = $this->manager['id'];
$this->param['test_model'] = 0;
}else{
$this->param['front_manager'] = $this->manager['id'];
}
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
if($rs === false){
$this->fail('修改失败,请联系管理员');
}
return $this->success(['id'=>$this->param['id']]);
}
}
... ...
... ... @@ -60,10 +60,8 @@ class UserLogic extends BaseLogic
}
$this->param = $this->editPassword($this->param);
$rs = $this->model->edit($this->param, ['id' => $this->param['id']]);
DB::table('gl_user_edit_log')->insert(['message'=>json_encode($this->param),'user_id'=>$this->manager['id'],'project_id'=>$this->user['project_id'],'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')]);
} else {
// $mobileModel = new Mobile();
// //查看当前手机号码是否存在于手机号码库
// $mobileInfo = $mobileModel->read(['mobile'=>$this->param['mobile']]);
$this->param['password'] = base64_encode(md5($this->param['password']));
$rs = $this->model->add($this->param);
}
... ...
... ... @@ -933,4 +933,24 @@ class BTemplateLogic extends BaseLogic
}
return $this->success();
}
/**
* @remark :设置模版
* @name :setCustomTemplate
* @author :lyh
* @method :post
* @time :2024/5/24 15:55
*/
public function setCustomTemplate(){
$templateModel = new Template();
$templateInfo = $templateModel->read(['id'=>$this->param['template_id']],['id','main_html','main_css']);
if($templateInfo === false){
$this->fail('未获取到模版数据');
}
if(empty($templateInfo['main_html']) || empty($templateInfo['main_css'])){
$this->fail('当前模版替换数据错误');
}
$this->model->edit(['html'=>$templateInfo['main_html'],'html_style'=>$templateInfo['main_css']],['id'=>$this->param['id']]);
return $this->success();
}
}
... ...
... ... @@ -404,4 +404,33 @@ class CustomTemplateLogic extends BaseLogic
}
return $this->success();
}
/**
* @remark :复制单页面
* @name :copyCustomTemplateInfo
* @author :lyh
* @method :post
* @time :2024/5/24 14:47
*/
public function copyCustomTemplateInfo(){
$info = $this->model->read(['id'=>$this->param['id']]);
if($info === false){
$this->fail('当前数据不存在');
}
$param = [
'name'=>$info['name'].'-copy',
'status'=>$info['status'],
'url'=>$info['url'].'-copy',
'html'=>$info['html'],
'html_style'=>$info['html_style'],
'project_id'=>$info['project_id'],
'is_visualization'=>$info['is_visualization'],
'six_read'=>$info['six_read'],
'is_upgrade'=>$info['is_upgrade'],
];
$id = $this->model->addReturnId($param);
$route = RouteMap::setRoute($param['url'],RouteMap::SOURCE_PAGE,$id,$param['project_id']);
$this->model->edit(['url'=>$route],['id'=>$id]);
return $this->success(['id'=>$id]);
}
}
... ...
... ... @@ -59,7 +59,7 @@ class CountLogic extends BaseLogic
*/
public function scheme_info(){
$data = [
'company'=>$this->project['company'],
'company'=>$this->project['company'] ?? '',
'scheme'=>Project::planMap()[$this->project['deploy_build']['plan']],
'service_duration'=>$this->project['deploy_build']['service_duration'],
];
... ...
... ... @@ -19,7 +19,6 @@ class NewsLogic extends BaseLogic
public function __construct()
{
parent::__construct();
$this->model = new News();
$this->param = $this->requestAll;
}
... ... @@ -61,8 +60,8 @@ class NewsLogic extends BaseLogic
public function newsSave()
{
//拼接参数
DB::beginTransaction();
try {
// DB::beginTransaction();
// try {
$this->param = $this->paramProcessing($this->param);
if (isset($this->param['id']) && !empty($this->param['id'])) {
$id = $this->param['id'];
... ... @@ -80,12 +79,12 @@ class NewsLogic extends BaseLogic
$route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']);
$this->edit(['url' => $route], ['id' => $id]);
}
//更新路由
DB::commit();
} catch (\Exception $e) {
DB::rollBack();
$this->fail('系统错误,请联系管理员');
}
// //更新路由
// DB::commit();
// } catch (\Exception $e) {
// DB::rollBack();
// $this->fail('系统错误,请联系管理员');
// }
$this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route);
$this->curlDelRoute(['new_route'=>$route]);
return $this->success(['id'=>$id]);
... ...
... ... @@ -97,6 +97,7 @@ class RankDataLogic extends BaseLogic
foreach($languageList as $lang){
$remain_day = $lang_data[$lang['lang']]['dabiao_day'] ?? 0;
$data['langs'][$lang['language'] ?? ''] = [
'lang'=>$lang['lang'],
'lang_text' => $lang['language'],
'keyword_num' => $lang['keywords'] ?? 0,
'reach_day' => $lang_data[$lang['lang']]['dabiao_day'] ?? 0,
... ... @@ -247,7 +248,7 @@ class RankDataLogic extends BaseLogic
$list = collect($list30)->merge($list30_0)->merge($list100)->merge($list0)->filter(function ($item) {
//搜索
if ($this->request['search']) {
return strpos($item['keyword'], $this->request['search']) !== false;
return strpos(strtolower($item['keyword']), strtolower($this->request['search'])) !== false;
}
//前几名
if ($this->request['first']) {
... ... @@ -485,6 +486,7 @@ class RankDataLogic extends BaseLogic
//保证关键词数
$keyword_num = DeployBuild::where('project_id', $project_id)->value('keyword_num');
$type = Project::where('id', $project_id)->value('type');
$model_is_compliance = $model->is_compliance;
$model->is_compliance = 0;
//是否达标
$is_compliance = $first_page_num >= $keyword_num;
... ... @@ -494,7 +496,7 @@ class RankDataLogic extends BaseLogic
if ($keyword_num && $type == Project::TYPE_TWO && $is_compliance) {
Log::channel('rank_data')->info('项目' . $project_id . ':关键词达标'. $keyword_num .' - ' . $first_page_num . ' - ' . $first_page_without_extension_num);
//项目表更新
if (($model->updated_date != date('Y-m-d') || empty($model->is_compliance)) && !$lang) {
if (($model->updated_date != date('Y-m-d') || empty($model_is_compliance)) && !$lang) {
$compliance_day = Project::where(['id' => $project_id])->value('finish_remain_day') ?: 0;
Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $compliance_day + 1]);
Log::channel('rank_data')->info('项目' . $project_id . '达标天数+1:'. ($compliance_day + 1));
... ...
... ... @@ -5,6 +5,7 @@ namespace App\Http\Logic\Bside\User;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\User\DeptUser;
use App\Models\User\User as UserModel;
use Illuminate\Support\Facades\DB;
class DeptUserLogic extends BaseLogic
{
... ...
... ... @@ -6,6 +6,7 @@ use App\Enums\Common\Code;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\User\User;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
class UserLogic extends BaseLogic
{
... ... @@ -84,6 +85,8 @@ class UserLogic extends BaseLogic
if($rs === false){
$this->fail('系统错误,请联系管理员');
}
//todo::写入日志
DB::table('gl_user_edit_log')->insert(['message'=>json_encode($this->param),'user_id'=>$this->user['id'],'project_id'=>$this->user['project_id'],'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')]);
return $this->success();
}
... ...
... ... @@ -47,13 +47,23 @@ class VisitLogic extends BaseLogic
* @method :post
* @time :2024/5/6 16:39
*/
public function downloadItem($map,$page,$row,$order,$filed = ['*']){
public function downloadItem($map,$page,$row,$order,$filed = ['id','depth','created_at','referrer_url','url','device_port','country','ip']){
$lists = $this->model->lists($map,$page,$row,$order,$filed);
$itemModel = new VisitItem();
if(!empty($lists) && !empty($lists['list'])){
foreach ($lists['list'] as $k => $v){
$v['sub'] = $itemModel->list(['customer_visit_id' => $v['id']]);
$lists['list'][$k] = $v;
foreach ($lists['list'] as $v){
$customer_visit_id[] = $v['id'];
}
$itemModel = new VisitItem();
$itemList = $itemModel->list(['customer_visit_id'=>['in',$customer_visit_id]],['customer_visit_id','url']);
foreach ($lists['list'] as $key => $value){
$sub = [];
foreach ($itemList as $sonValue){
if($value['id'] == $sonValue['customer_visit_id']){
$sub[] = $sonValue;
}
}
$value['sub'] = $sub;
$lists['list'][$key] = $value;
}
}
return $this->success($lists);
... ...
... ... @@ -25,7 +25,7 @@ class BlogRequest extends FormRequest
{
return [
'name'=>'required|max:200',
// 'remark'=>'max:500',
'seo_keywords'=>'max:1000',
'url'=>'required',
];
}
... ... @@ -36,7 +36,7 @@ class BlogRequest extends FormRequest
'name.required'=>'请填写名称',
'name.max'=>'名称超过最长长度200',
'url.required'=>'链接不能为空',
// 'remark.max'=>'描述超过最长长度500'
'seo_keywords.max'=>'seo_keywords太长,请重新编辑'
];
}
}
... ...
... ... @@ -60,10 +60,20 @@ class CopyProjectJob implements ShouldQueue
$data['status'] = 0;
$data['finish_remain_day'] = 0;
$data['title'] = $data['title'].'-copy';
$data['delete_status'] = 1;
unset($data['id']);
$project_id = $projectModel->insertGetId($data);
$hashids = new Hashids($data['from_order_id'], 13, 'abcdefghjkmnpqrstuvwxyz1234567890');
$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();
if(!empty($settingData)){
$settingData = $settingData->getAttributes();
unset($settingData['id']);
$settingData['project_id'] = $project_id;
$settingTemplateModel->insert($settingData);
}
//复制部署表
$buildModel = new DeployBuild();
$buildData = $buildModel::where('project_id', $this->param['project_id'])->first();
... ... @@ -114,15 +124,6 @@ class CopyProjectJob implements ShouldQueue
$userData['project_id'] = $project_id;
$userModel->insert($userData);
}
//复制设置的模版
$settingTemplateModel = new Setting();
$settingData = $settingTemplateModel::where('project_id', $this->param['project_id'])->first();
if(!empty($settingData)){
$settingData = $settingData->getAttributes();
unset($settingData['id']);
$settingData['project_id'] = $project_id;
$settingTemplateModel->insert($settingData);
}
DB::commit();
}catch (\Exception $e){
DB::rollBack();
... ... @@ -131,6 +132,8 @@ class CopyProjectJob implements ShouldQueue
if($type != 0){
$this->copyMysql($this->param['project_id'],$project_id);
}
//修改项目状态
$projectModel->edit(['delete_status'=>0],['id'=>$project_id]);
return true;
}
... ...
... ... @@ -358,6 +358,7 @@ Route::middleware(['aloginauth'])->group(function () {
Route::any('/setHeadFooter', [Aside\Template\ATemplateController::class, 'setHeadFooter'])->name('admin.template_setHeadFooter');
Route::any('/getHeadFooter', [Aside\Template\ATemplateController::class, 'getHeadFooter'])->name('admin.template_getHeadFooter');
Route::any('/setPublicTemplate', [Aside\Template\ATemplateController::class, 'setPublicTemplate'])->name('admin.template_setPublicTemplate');
Route::any('/auditingStatus', [Aside\Template\ATemplateController::class, 'auditingStatus'])->name('admin.template_auditingStatus');
Route::any('/getProjectPublicTemplate', [Aside\Template\ATemplateController::class, 'getProjectPublicTemplate'])->name('admin.template_getProjectPublicTemplate');
// 左侧模块
Route::prefix('module')->group(function () {
... ...
... ... @@ -361,6 +361,7 @@ Route::middleware(['bloginauth'])->group(function () {
Route::any('/savePublicTemplate', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'savePublicTemplate'])->name('template_savePublicTemplate');
Route::any('/getDetailInfo', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'getDetailInfo'])->name('template_getDetailInfo');
Route::any('/saveDetail', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'saveDetail'])->name('template_saveDetail');
Route::any('/setPublicTemplate', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'setPublicTemplate'])->name('template_setPublicTemplate');
// 模板
Route::prefix('module')->group(function () {
//获取所有左侧模版
... ...