Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
14 个修改的文件
包含
250 行增加
和
17 行删除
| @@ -79,9 +79,6 @@ class Count extends Command | @@ -79,9 +79,6 @@ class Count extends Command | ||
| 79 | $arr['updated_at'] = date('Y-m-d H:i:s'); | 79 | $arr['updated_at'] = date('Y-m-d H:i:s'); |
| 80 | //询盘统计 | 80 | //询盘统计 |
| 81 | $arr = $this->inquiry($arr,$v['test_domain'], $v['id'] , $v['is_upgrade'] ?? 0); | 81 | $arr = $this->inquiry($arr,$v['test_domain'], $v['id'] , $v['is_upgrade'] ?? 0); |
| 82 | - if($arr === false){ | ||
| 83 | - continue; | ||
| 84 | - } | ||
| 85 | //查询当天数据是否存在 存在则更新 | 82 | //查询当天数据是否存在 存在则更新 |
| 86 | $countModel = new \App\Models\HomeCount\Count(); | 83 | $countModel = new \App\Models\HomeCount\Count(); |
| 87 | $info = $countModel->read(['date'=>$arr['date'],'project_id'=>$v['id']]); | 84 | $info = $countModel->read(['date'=>$arr['date'],'project_id'=>$v['id']]); |
| @@ -133,7 +130,7 @@ class Count extends Command | @@ -133,7 +130,7 @@ class Count extends Command | ||
| 133 | public function inquiry($arr,$domain,$project_id,$is_upgrade = 0){ | 130 | public function inquiry($arr,$domain,$project_id,$is_upgrade = 0){ |
| 134 | $inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$is_upgrade); | 131 | $inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$is_upgrade); |
| 135 | if($inquiry_list == false){ | 132 | if($inquiry_list == false){ |
| 136 | - return false; | 133 | + return $arr; |
| 137 | } | 134 | } |
| 138 | if($inquiry_list['status'] == self::STATUS_ERROR){ | 135 | if($inquiry_list['status'] == self::STATUS_ERROR){ |
| 139 | $arr['inquiry_num'] = 0; | 136 | $arr['inquiry_num'] = 0; |
| @@ -103,7 +103,7 @@ class CountAll extends Command | @@ -103,7 +103,7 @@ class CountAll extends Command | ||
| 103 | public function inquiry($arr,$domain,$project_id,$is_upgrade = 0){ | 103 | public function inquiry($arr,$domain,$project_id,$is_upgrade = 0){ |
| 104 | $inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$is_upgrade); | 104 | $inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$is_upgrade); |
| 105 | if($inquiry_list == false){ | 105 | if($inquiry_list == false){ |
| 106 | - return false; | 106 | + return $arr; |
| 107 | } | 107 | } |
| 108 | if($inquiry_list['status'] == self::STATUS_ERROR){ | 108 | if($inquiry_list['status'] == self::STATUS_ERROR){ |
| 109 | $arr['inquiry_num'] = 0; | 109 | $arr['inquiry_num'] = 0; |
| @@ -134,7 +134,7 @@ class CountDate extends Command | @@ -134,7 +134,7 @@ class CountDate extends Command | ||
| 134 | public function inquiry($arr,$domain,$project_id,$is_upgrade = 0){ | 134 | public function inquiry($arr,$domain,$project_id,$is_upgrade = 0){ |
| 135 | $inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$is_upgrade); | 135 | $inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$is_upgrade); |
| 136 | if($inquiry_list == false){ | 136 | if($inquiry_list == false){ |
| 137 | - return false; | 137 | + return $arr; |
| 138 | } | 138 | } |
| 139 | if($inquiry_list['status'] == self::STATUS_ERROR){ | 139 | if($inquiry_list['status'] == self::STATUS_ERROR){ |
| 140 | $arr['inquiry_num'] = 0; | 140 | $arr['inquiry_num'] = 0; |
| @@ -172,8 +172,8 @@ class SyncInquiryProject extends Command | @@ -172,8 +172,8 @@ class SyncInquiryProject extends Command | ||
| 172 | ProjectServer::useProject($val->id); | 172 | ProjectServer::useProject($val->id); |
| 173 | 173 | ||
| 174 | //排除白帽个人服务器项目 | 174 | //排除白帽个人服务器项目 |
| 175 | - $seo_type = WebSetting::where('project_id', $val->id)->value('seo_type'); | ||
| 176 | - if ($seo_type == 2) { | 175 | + $web_setting = WebSetting::where('project_id', $val->id)->first(); |
| 176 | + if (isset($web_setting->seo_type) && $web_setting->seo_type == 2) { | ||
| 177 | DB::disconnect('custom_mysql'); | 177 | DB::disconnect('custom_mysql'); |
| 178 | continue; | 178 | continue; |
| 179 | } | 179 | } |
| @@ -73,13 +73,12 @@ class GeoController extends BaseController | @@ -73,13 +73,12 @@ class GeoController extends BaseController | ||
| 73 | $this->request->validate([ | 73 | $this->request->validate([ |
| 74 | 'token' => 'required', | 74 | 'token' => 'required', |
| 75 | 'title' => 'required|max:120', | 75 | 'title' => 'required|max:120', |
| 76 | - 'content' => 'required|max:5000' | 76 | + 'content' => 'required' |
| 77 | ], [ | 77 | ], [ |
| 78 | 'token.required' => '非法请求', | 78 | 'token.required' => '非法请求', |
| 79 | 'title.required' => '标题不能为空', | 79 | 'title.required' => '标题不能为空', |
| 80 | 'title.max' => '最大长度不能超过120字符', | 80 | 'title.max' => '最大长度不能超过120字符', |
| 81 | 'content.required' => '内容不能为空', | 81 | 'content.required' => '内容不能为空', |
| 82 | - 'content.max' => '内容过长保存失败', | ||
| 83 | ]); | 82 | ]); |
| 84 | $token = trim($this->param['token']); | 83 | $token = trim($this->param['token']); |
| 85 | $geoWritingsModel = new GeoWritings(); | 84 | $geoWritingsModel = new GeoWritings(); |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :Project5CateController.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/11/8 09:35 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Controllers\Api\WorkOrder; | ||
| 11 | + | ||
| 12 | +use App\Enums\Common\Code; | ||
| 13 | +use App\Http\Controllers\Api\BaseController; | ||
| 14 | +use App\Models\Ticket\Project5Cate; | ||
| 15 | +use App\Models\WorkOrder\TicketProject; | ||
| 16 | + | ||
| 17 | +class Project5CateController extends BaseController | ||
| 18 | +{ | ||
| 19 | + /** | ||
| 20 | + * @remark :获取对应项目的分类 | ||
| 21 | + * @name :getProject5Cate | ||
| 22 | + * @author :lyh | ||
| 23 | + * @method :post | ||
| 24 | + * @time :2025/11/8 09:27 | ||
| 25 | + */ | ||
| 26 | + public function getProject5Cate(){ | ||
| 27 | + $this->request->validate([ | ||
| 28 | + 'post_id'=>'required', | ||
| 29 | + 'type'=>'required', | ||
| 30 | + ],[ | ||
| 31 | + 'post_id.required' => 'post_id不能为空', | ||
| 32 | + 'type.required' => '类型不能为空', | ||
| 33 | + ]); | ||
| 34 | + //查询是否有值 | ||
| 35 | + $project5CateModel = new Project5Cate(); | ||
| 36 | + $cateInfo = $project5CateModel->read(['project_id' => $this->param['post_id'],'type'=>$this->param['type'],'updated_at'=>['>', date('Y-m-d H:i:s', strtotime('-48 hours'))]]); | ||
| 37 | + if($cateInfo !== false){ | ||
| 38 | + $resultData = $cateInfo['text']; | ||
| 39 | + $this->response('success', Code::SUCCESS, $resultData); | ||
| 40 | + } | ||
| 41 | + //获取域名 | ||
| 42 | + $ticketProjectMdoel = new TicketProject(); | ||
| 43 | + $projectInfo = $ticketProjectMdoel->read(['post_id' => $this->param['post_id']]); | ||
| 44 | + if($projectInfo === false){ | ||
| 45 | + $this->response('当前项目不存在或数据未同步',Code::SYSTEM_ERROR); | ||
| 46 | + } | ||
| 47 | + //todo::目前写死 | ||
| 48 | + $projectInfo['website'] = 'https://devmark.globalso.com/'; | ||
| 49 | + $action = $project5CateModel->getCateType($this->param['type']); | ||
| 50 | + if(empty($action)){ | ||
| 51 | + $this->response('未知请求',Code::SYSTEM_ERROR); | ||
| 52 | + } | ||
| 53 | + $url = $projectInfo['website'].'wp-admin/admin-ajax.php?action='.$action; | ||
| 54 | + $data = http_get($url); | ||
| 55 | + if($data && $data['status'] == 200){ | ||
| 56 | + $resultData = $data['data']; | ||
| 57 | + $saveData = [ | ||
| 58 | + 'project_id' => $projectInfo['post_id'], | ||
| 59 | + 'domain' => $projectInfo['website'], | ||
| 60 | + 'text'=>json_encode($data['data']), | ||
| 61 | + 'type' => $this->param['type'], | ||
| 62 | + ]; | ||
| 63 | + $project5CateModel->addReturnId($saveData); | ||
| 64 | + $this->response('success', Code::SUCCESS,$resultData); | ||
| 65 | + } | ||
| 66 | + $this->response('success',Code::SUCCESS,$url); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + /** | ||
| 70 | + * @remark :新增分类 | ||
| 71 | + * @name :addProject5Cate | ||
| 72 | + * @author :lyh | ||
| 73 | + * @method :post | ||
| 74 | + * @time :2025/11/8 10:25 | ||
| 75 | + */ | ||
| 76 | + public function addProject5Cate() | ||
| 77 | + { | ||
| 78 | + $this->request->validate([ | ||
| 79 | + 'post_id'=>'required', | ||
| 80 | + 'type'=>'required', | ||
| 81 | + 'name'=>'required', | ||
| 82 | + 'parent'=>'required', | ||
| 83 | + ],[ | ||
| 84 | + 'post_id.required' => 'post_id不能为空', | ||
| 85 | + 'type.required' => '类型不能为空', | ||
| 86 | + 'name.required' => '名称不能为空', | ||
| 87 | + 'parent.required' => '上级ID不能为空', | ||
| 88 | + ]); | ||
| 89 | + //获取域名 | ||
| 90 | + $ticketProjectMdoel = new TicketProject(); | ||
| 91 | + $projectInfo = $ticketProjectMdoel->read(['post_id' => $this->param['post_id']]); | ||
| 92 | + if($projectInfo === false){ | ||
| 93 | + $this->response('当前项目不存在或数据未同步',Code::SYSTEM_ERROR); | ||
| 94 | + } | ||
| 95 | + $project5CateModel = new Project5Cate(); | ||
| 96 | + $projectInfo['website'] = 'https://devmark.globalso.com/'; | ||
| 97 | + $action = $project5CateModel->saveCateTypeAction($this->param['type']); | ||
| 98 | + $url = $projectInfo['website'].'wp-admin/admin-ajax.php?action='.$action; | ||
| 99 | + if(empty($action)){ | ||
| 100 | + $this->response('未知请求',Code::SYSTEM_ERROR); | ||
| 101 | + } | ||
| 102 | + $data = http_post($url,json_encode(['name'=>$this->param['name'],'parent'=>$this->param['parent']],true)); | ||
| 103 | + if($data && $data['status'] == 200){ | ||
| 104 | + $this->response('success', ); | ||
| 105 | + } | ||
| 106 | + $this->response('请求失败',Code::SYSTEM_ERROR); | ||
| 107 | + } | ||
| 108 | +} |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :Project5CateController.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/11/8 09:25 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Controllers\Aside\Ticket; | ||
| 11 | + | ||
| 12 | +use App\Http\Controllers\Aside\BaseController; | ||
| 13 | +use App\Http\Logic\Aside\Ticket\Project5CateLogic; | ||
| 14 | +use Illuminate\Http\Request; | ||
| 15 | + | ||
| 16 | +/** | ||
| 17 | + * @remark :保存5.0的分类 | ||
| 18 | + * @name :Project5CateController | ||
| 19 | + * @author :lyh | ||
| 20 | + * @method :post | ||
| 21 | + * @time :2025/11/8 09:26 | ||
| 22 | + */ | ||
| 23 | +class Project5CateController extends BaseController | ||
| 24 | +{ | ||
| 25 | + public function __construct(Request $request) | ||
| 26 | + { | ||
| 27 | + parent::__construct($request); | ||
| 28 | + $this->logic = new Project5CateLogic(); | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + | ||
| 32 | +} |
| @@ -40,7 +40,7 @@ class GeoConfirmLogic extends BaseLogic | @@ -40,7 +40,7 @@ class GeoConfirmLogic extends BaseLogic | ||
| 40 | public function saveConfirmContent($param) | 40 | public function saveConfirmContent($param) |
| 41 | { | 41 | { |
| 42 | try { | 42 | try { |
| 43 | - $wechat = $param['wechat']; | 43 | + $wechat = $param['wechat'] ?? true; |
| 44 | unset($param['wechat']); | 44 | unset($param['wechat']); |
| 45 | $info = $this->model->read(['project_id' => $param['project_id'],'type' => $param['type']]); | 45 | $info = $this->model->read(['project_id' => $param['project_id'],'type' => $param['type']]); |
| 46 | if($info === false){ | 46 | if($info === false){ |
| @@ -102,8 +102,9 @@ class GeoWritingsLogic extends BaseLogic | @@ -102,8 +102,9 @@ class GeoWritingsLogic extends BaseLogic | ||
| 102 | */ | 102 | */ |
| 103 | public function sendWechatMessage() | 103 | public function sendWechatMessage() |
| 104 | { | 104 | { |
| 105 | + $wechat = $this->param['wechat'] ?? true; | ||
| 105 | $this->model->edit(['status'=>2],['status'=>1,'project_id'=>$this->param['project_id']]); | 106 | $this->model->edit(['status'=>2],['status'=>1,'project_id'=>$this->param['project_id']]); |
| 106 | - $data = GeoWritings::sendConfirmMessage($this->param['project_id']); | 107 | + $data = GeoWritings::sendConfirmMessage($this->param['project_id'],$wechat); |
| 107 | if($data === false){ | 108 | if($data === false){ |
| 108 | $this->fail('项目未绑定微信群'); | 109 | $this->fail('项目未绑定微信群'); |
| 109 | } | 110 | } |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :Project5CateLogic.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/11/8 09:26 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Logic\Aside\Ticket; | ||
| 11 | + | ||
| 12 | +use App\Http\Logic\Aside\BaseLogic; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * @remark :5.0的分类 | ||
| 16 | + * @name :Project5CateLogic | ||
| 17 | + * @author :lyh | ||
| 18 | + * @method :post | ||
| 19 | + * @time :2025/11/8 09:26 | ||
| 20 | + */ | ||
| 21 | +class Project5CateLogic extends BaseLogic | ||
| 22 | +{ | ||
| 23 | + public function __construct() | ||
| 24 | + { | ||
| 25 | + parent::__construct(); | ||
| 26 | + $this->param = $this->requestAll; | ||
| 27 | + } | ||
| 28 | +} |
| @@ -44,7 +44,7 @@ class RankDataLogic extends BaseLogic | @@ -44,7 +44,7 @@ class RankDataLogic extends BaseLogic | ||
| 44 | { | 44 | { |
| 45 | parent::__construct(); | 45 | parent::__construct(); |
| 46 | $this->param = $this->requestAll; | 46 | $this->param = $this->requestAll; |
| 47 | - if($this->user['project_id'] == 5172){ | 47 | + if(isset($this->user['project_id']) && ($this->user['project_id'] == 5172)){ |
| 48 | $this->user['project_id'] = 3298; | 48 | $this->user['project_id'] = 3298; |
| 49 | } | 49 | } |
| 50 | } | 50 | } |
| @@ -77,7 +77,7 @@ class GeoWritings extends Base | @@ -77,7 +77,7 @@ class GeoWritings extends Base | ||
| 77 | * @return bool | 77 | * @return bool |
| 78 | * @throws \Exception | 78 | * @throws \Exception |
| 79 | */ | 79 | */ |
| 80 | - public static function sendConfirmMessage($project_id) | 80 | + public static function sendConfirmMessage($project_id,$wechat = true) |
| 81 | { | 81 | { |
| 82 | $friend = ProjectAssociation::where(['project_id' => $project_id])->first(); | 82 | $friend = ProjectAssociation::where(['project_id' => $project_id])->first(); |
| 83 | if (empty($friend)) { | 83 | if (empty($friend)) { |
| @@ -104,9 +104,11 @@ class GeoWritings extends Base | @@ -104,9 +104,11 @@ class GeoWritings extends Base | ||
| 104 | 'thumbUrl' => 'https://hub.globalso.com/logocm.png', | 104 | 'thumbUrl' => 'https://hub.globalso.com/logocm.png', |
| 105 | 'url' => 'https://oa.quanqiusou.cn/public-geo-article-list?token=' . $token | 105 | 'url' => 'https://oa.quanqiusou.cn/public-geo-article-list?token=' . $token |
| 106 | ]; | 106 | ]; |
| 107 | - $content = json_encode($content_array, JSON_UNESCAPED_UNICODE); | ||
| 108 | - MessagePush::insert(compact('project_id', 'friend_id', 'type', 'content_type', 'content', 'send_time', 'updated_at', 'created_at')); | ||
| 109 | - return true; | 107 | + if($wechat){ |
| 108 | + $content = json_encode($content_array, JSON_UNESCAPED_UNICODE); | ||
| 109 | + MessagePush::insert(compact('project_id', 'friend_id', 'type', 'content_type', 'content', 'send_time', 'updated_at', 'created_at')); | ||
| 110 | + } | ||
| 111 | + return $content_array; | ||
| 110 | } | 112 | } |
| 111 | 113 | ||
| 112 | } | 114 | } |
app/Models/Ticket/Project5Cate.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :Project5Cate.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/11/8 09:23 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Models\Ticket; | ||
| 11 | + | ||
| 12 | +use App\Helper\Arr; | ||
| 13 | +use App\Models\Base; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * @remark :5.0数据分类 | ||
| 17 | + * @name :Project5Cate | ||
| 18 | + * @author :lyh | ||
| 19 | + * @method :post | ||
| 20 | + * @time :2025/11/8 09:24 | ||
| 21 | + */ | ||
| 22 | +class Project5Cate extends Base | ||
| 23 | +{ | ||
| 24 | + protected $table = 'gl_project_5_cate'; | ||
| 25 | + | ||
| 26 | + public function getTextAttribute($value){ | ||
| 27 | + if(!empty($value)){ | ||
| 28 | + $value = Arr::s2a($value); | ||
| 29 | + } | ||
| 30 | + return $value; | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + /** | ||
| 34 | + * @remark :请求的方法 | ||
| 35 | + * @name :getCateType | ||
| 36 | + * @author :lyh | ||
| 37 | + * @method :post | ||
| 38 | + * @time :2025/11/8 10:22 | ||
| 39 | + */ | ||
| 40 | + public function getCateTypeAction($type = '') | ||
| 41 | + { | ||
| 42 | + $data = [ | ||
| 43 | + 1 => 'get_products_category', | ||
| 44 | + 3 => 'get_news_category', | ||
| 45 | + ]; | ||
| 46 | + if(!empty($type)){ | ||
| 47 | + return $data[$type]; | ||
| 48 | + } | ||
| 49 | + return ''; | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + public function saveCateTypeAction($type = '') | ||
| 53 | + { | ||
| 54 | + $data = [ | ||
| 55 | + 1 => 'add_products_category', | ||
| 56 | + 3 => 'add_news_category', | ||
| 57 | + ]; | ||
| 58 | + if(!empty($type)){ | ||
| 59 | + return $data[$type]; | ||
| 60 | + } | ||
| 61 | + return ''; | ||
| 62 | + } | ||
| 63 | +} |
| @@ -109,6 +109,8 @@ Route::prefix('ticket_upload')->group(function () { | @@ -109,6 +109,8 @@ Route::prefix('ticket_upload')->group(function () { | ||
| 109 | Route::any('/sendLayoutDesign', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'sendLayoutDesign'])->name('ticket_upload.sendLayoutDesign'); | 109 | Route::any('/sendLayoutDesign', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'sendLayoutDesign'])->name('ticket_upload.sendLayoutDesign'); |
| 110 | Route::any('/saveLayoutDesign', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'saveLayoutDesign'])->name('ticket_upload.saveLayoutDesign'); | 110 | Route::any('/saveLayoutDesign', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'saveLayoutDesign'])->name('ticket_upload.saveLayoutDesign'); |
| 111 | Route::any('/getLayoutDesignInfo', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'getLayoutDesignInfo'])->name('ticket_upload.getLayoutDesignInfo'); | 111 | Route::any('/getLayoutDesignInfo', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'getLayoutDesignInfo'])->name('ticket_upload.getLayoutDesignInfo'); |
| 112 | + //5.0获取分类 | ||
| 113 | + Route::any('/getProject5Cate', [\App\Http\Controllers\Api\WorkOrder\Project5CateController::class, 'getProject5Cate'])->name('ticket_upload.getProject5Cate'); | ||
| 112 | }); | 114 | }); |
| 113 | //geo设置 | 115 | //geo设置 |
| 114 | Route::prefix('geo')->group(function () { | 116 | Route::prefix('geo')->group(function () { |
| @@ -120,3 +122,4 @@ Route::prefix('geo')->group(function () { | @@ -120,3 +122,4 @@ Route::prefix('geo')->group(function () { | ||
| 120 | Route::any('/confirmWritings', [\App\Http\Controllers\Api\GeoController::class, 'confirmWritings'])->name('geo.confirmWritings');//确认文章信息 | 122 | Route::any('/confirmWritings', [\App\Http\Controllers\Api\GeoController::class, 'confirmWritings'])->name('geo.confirmWritings');//确认文章信息 |
| 121 | }); | 123 | }); |
| 122 | 124 | ||
| 125 | + |
-
请 注册 或 登录 后发表评论