作者 赵彬吉
... ... @@ -79,9 +79,6 @@ class Count extends Command
$arr['updated_at'] = date('Y-m-d H:i:s');
//询盘统计
$arr = $this->inquiry($arr,$v['test_domain'], $v['id'] , $v['is_upgrade'] ?? 0);
if($arr === false){
continue;
}
//查询当天数据是否存在 存在则更新
$countModel = new \App\Models\HomeCount\Count();
$info = $countModel->read(['date'=>$arr['date'],'project_id'=>$v['id']]);
... ... @@ -133,7 +130,7 @@ class Count extends Command
public function inquiry($arr,$domain,$project_id,$is_upgrade = 0){
$inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$is_upgrade);
if($inquiry_list == false){
return false;
return $arr;
}
if($inquiry_list['status'] == self::STATUS_ERROR){
$arr['inquiry_num'] = 0;
... ...
... ... @@ -103,7 +103,7 @@ class CountAll extends Command
public function inquiry($arr,$domain,$project_id,$is_upgrade = 0){
$inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$is_upgrade);
if($inquiry_list == false){
return false;
return $arr;
}
if($inquiry_list['status'] == self::STATUS_ERROR){
$arr['inquiry_num'] = 0;
... ...
... ... @@ -134,7 +134,7 @@ class CountDate extends Command
public function inquiry($arr,$domain,$project_id,$is_upgrade = 0){
$inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$is_upgrade);
if($inquiry_list == false){
return false;
return $arr;
}
if($inquiry_list['status'] == self::STATUS_ERROR){
$arr['inquiry_num'] = 0;
... ...
... ... @@ -172,8 +172,8 @@ class SyncInquiryProject extends Command
ProjectServer::useProject($val->id);
//排除白帽个人服务器项目
$seo_type = WebSetting::where('project_id', $val->id)->value('seo_type');
if ($seo_type == 2) {
$web_setting = WebSetting::where('project_id', $val->id)->first();
if (isset($web_setting->seo_type) && $web_setting->seo_type == 2) {
DB::disconnect('custom_mysql');
continue;
}
... ...
... ... @@ -73,13 +73,12 @@ class GeoController extends BaseController
$this->request->validate([
'token' => 'required',
'title' => 'required|max:120',
'content' => 'required|max:5000'
'content' => 'required'
], [
'token.required' => '非法请求',
'title.required' => '标题不能为空',
'title.max' => '最大长度不能超过120字符',
'content.required' => '内容不能为空',
'content.max' => '内容过长保存失败',
]);
$token = trim($this->param['token']);
$geoWritingsModel = new GeoWritings();
... ...
<?php
/**
* @remark :
* @name :Project5CateController.php
* @author :lyh
* @method :post
* @time :2025/11/8 09:35
*/
namespace App\Http\Controllers\Api\WorkOrder;
use App\Enums\Common\Code;
use App\Http\Controllers\Api\BaseController;
use App\Models\Ticket\Project5Cate;
use App\Models\WorkOrder\TicketProject;
class Project5CateController extends BaseController
{
/**
* @remark :获取对应项目的分类
* @name :getProject5Cate
* @author :lyh
* @method :post
* @time :2025/11/8 09:27
*/
public function getProject5Cate(){
$this->request->validate([
'post_id'=>'required',
'type'=>'required',
],[
'post_id.required' => 'post_id不能为空',
'type.required' => '类型不能为空',
]);
//查询是否有值
$project5CateModel = new Project5Cate();
$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'))]]);
if($cateInfo !== false){
$resultData = $cateInfo['text'];
$this->response('success', Code::SUCCESS, $resultData);
}
//获取域名
$ticketProjectMdoel = new TicketProject();
$projectInfo = $ticketProjectMdoel->read(['post_id' => $this->param['post_id']]);
if($projectInfo === false){
$this->response('当前项目不存在或数据未同步',Code::SYSTEM_ERROR);
}
//todo::目前写死
$projectInfo['website'] = 'https://devmark.globalso.com/';
$action = $project5CateModel->getCateType($this->param['type']);
if(empty($action)){
$this->response('未知请求',Code::SYSTEM_ERROR);
}
$url = $projectInfo['website'].'wp-admin/admin-ajax.php?action='.$action;
$data = http_get($url);
if($data && $data['status'] == 200){
$resultData = $data['data'];
$saveData = [
'project_id' => $projectInfo['post_id'],
'domain' => $projectInfo['website'],
'text'=>json_encode($data['data']),
'type' => $this->param['type'],
];
$project5CateModel->addReturnId($saveData);
$this->response('success', Code::SUCCESS,$resultData);
}
$this->response('success',Code::SUCCESS,$url);
}
/**
* @remark :新增分类
* @name :addProject5Cate
* @author :lyh
* @method :post
* @time :2025/11/8 10:25
*/
public function addProject5Cate()
{
$this->request->validate([
'post_id'=>'required',
'type'=>'required',
'name'=>'required',
'parent'=>'required',
],[
'post_id.required' => 'post_id不能为空',
'type.required' => '类型不能为空',
'name.required' => '名称不能为空',
'parent.required' => '上级ID不能为空',
]);
//获取域名
$ticketProjectMdoel = new TicketProject();
$projectInfo = $ticketProjectMdoel->read(['post_id' => $this->param['post_id']]);
if($projectInfo === false){
$this->response('当前项目不存在或数据未同步',Code::SYSTEM_ERROR);
}
$project5CateModel = new Project5Cate();
$projectInfo['website'] = 'https://devmark.globalso.com/';
$action = $project5CateModel->saveCateTypeAction($this->param['type']);
$url = $projectInfo['website'].'wp-admin/admin-ajax.php?action='.$action;
if(empty($action)){
$this->response('未知请求',Code::SYSTEM_ERROR);
}
$data = http_post($url,json_encode(['name'=>$this->param['name'],'parent'=>$this->param['parent']],true));
if($data && $data['status'] == 200){
$this->response('success', );
}
$this->response('请求失败',Code::SYSTEM_ERROR);
}
}
... ...
<?php
/**
* @remark :
* @name :Project5CateController.php
* @author :lyh
* @method :post
* @time :2025/11/8 09:25
*/
namespace App\Http\Controllers\Aside\Ticket;
use App\Http\Controllers\Aside\BaseController;
use App\Http\Logic\Aside\Ticket\Project5CateLogic;
use Illuminate\Http\Request;
/**
* @remark :保存5.0的分类
* @name :Project5CateController
* @author :lyh
* @method :post
* @time :2025/11/8 09:26
*/
class Project5CateController extends BaseController
{
public function __construct(Request $request)
{
parent::__construct($request);
$this->logic = new Project5CateLogic();
}
}
... ...
... ... @@ -40,7 +40,7 @@ class GeoConfirmLogic extends BaseLogic
public function saveConfirmContent($param)
{
try {
$wechat = $param['wechat'];
$wechat = $param['wechat'] ?? true;
unset($param['wechat']);
$info = $this->model->read(['project_id' => $param['project_id'],'type' => $param['type']]);
if($info === false){
... ...
... ... @@ -102,8 +102,9 @@ class GeoWritingsLogic extends BaseLogic
*/
public function sendWechatMessage()
{
$wechat = $this->param['wechat'] ?? true;
$this->model->edit(['status'=>2],['status'=>1,'project_id'=>$this->param['project_id']]);
$data = GeoWritings::sendConfirmMessage($this->param['project_id']);
$data = GeoWritings::sendConfirmMessage($this->param['project_id'],$wechat);
if($data === false){
$this->fail('项目未绑定微信群');
}
... ...
<?php
/**
* @remark :
* @name :Project5CateLogic.php
* @author :lyh
* @method :post
* @time :2025/11/8 09:26
*/
namespace App\Http\Logic\Aside\Ticket;
use App\Http\Logic\Aside\BaseLogic;
/**
* @remark :5.0的分类
* @name :Project5CateLogic
* @author :lyh
* @method :post
* @time :2025/11/8 09:26
*/
class Project5CateLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->param = $this->requestAll;
}
}
... ...
... ... @@ -44,7 +44,7 @@ class RankDataLogic extends BaseLogic
{
parent::__construct();
$this->param = $this->requestAll;
if($this->user['project_id'] == 5172){
if(isset($this->user['project_id']) && ($this->user['project_id'] == 5172)){
$this->user['project_id'] = 3298;
}
}
... ...
... ... @@ -77,7 +77,7 @@ class GeoWritings extends Base
* @return bool
* @throws \Exception
*/
public static function sendConfirmMessage($project_id)
public static function sendConfirmMessage($project_id,$wechat = true)
{
$friend = ProjectAssociation::where(['project_id' => $project_id])->first();
if (empty($friend)) {
... ... @@ -104,9 +104,11 @@ class GeoWritings extends Base
'thumbUrl' => 'https://hub.globalso.com/logocm.png',
'url' => 'https://oa.quanqiusou.cn/public-geo-article-list?token=' . $token
];
$content = json_encode($content_array, JSON_UNESCAPED_UNICODE);
MessagePush::insert(compact('project_id', 'friend_id', 'type', 'content_type', 'content', 'send_time', 'updated_at', 'created_at'));
return true;
if($wechat){
$content = json_encode($content_array, JSON_UNESCAPED_UNICODE);
MessagePush::insert(compact('project_id', 'friend_id', 'type', 'content_type', 'content', 'send_time', 'updated_at', 'created_at'));
}
return $content_array;
}
}
... ...
<?php
/**
* @remark :
* @name :Project5Cate.php
* @author :lyh
* @method :post
* @time :2025/11/8 09:23
*/
namespace App\Models\Ticket;
use App\Helper\Arr;
use App\Models\Base;
/**
* @remark :5.0数据分类
* @name :Project5Cate
* @author :lyh
* @method :post
* @time :2025/11/8 09:24
*/
class Project5Cate extends Base
{
protected $table = 'gl_project_5_cate';
public function getTextAttribute($value){
if(!empty($value)){
$value = Arr::s2a($value);
}
return $value;
}
/**
* @remark :请求的方法
* @name :getCateType
* @author :lyh
* @method :post
* @time :2025/11/8 10:22
*/
public function getCateTypeAction($type = '')
{
$data = [
1 => 'get_products_category',
3 => 'get_news_category',
];
if(!empty($type)){
return $data[$type];
}
return '';
}
public function saveCateTypeAction($type = '')
{
$data = [
1 => 'add_products_category',
3 => 'add_news_category',
];
if(!empty($type)){
return $data[$type];
}
return '';
}
}
... ...
... ... @@ -109,6 +109,8 @@ Route::prefix('ticket_upload')->group(function () {
Route::any('/sendLayoutDesign', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'sendLayoutDesign'])->name('ticket_upload.sendLayoutDesign');
Route::any('/saveLayoutDesign', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'saveLayoutDesign'])->name('ticket_upload.saveLayoutDesign');
Route::any('/getLayoutDesignInfo', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'getLayoutDesignInfo'])->name('ticket_upload.getLayoutDesignInfo');
//5.0获取分类
Route::any('/getProject5Cate', [\App\Http\Controllers\Api\WorkOrder\Project5CateController::class, 'getProject5Cate'])->name('ticket_upload.getProject5Cate');
});
//geo设置
Route::prefix('geo')->group(function () {
... ... @@ -120,3 +122,4 @@ Route::prefix('geo')->group(function () {
Route::any('/confirmWritings', [\App\Http\Controllers\Api\GeoController::class, 'confirmWritings'])->name('geo.confirmWritings');//确认文章信息
});
... ...