作者 刘锟

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

@@ -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;
@@ -29,6 +29,7 @@ use App\Models\WebSetting\Translate; @@ -29,6 +29,7 @@ use App\Models\WebSetting\Translate;
29 use App\Models\WebSetting\TranslateData; 29 use App\Models\WebSetting\TranslateData;
30 use App\Models\WebSetting\WebSetting; 30 use App\Models\WebSetting\WebSetting;
31 use App\Models\WorkOrder\TicketLog; 31 use App\Models\WorkOrder\TicketLog;
  32 +use App\Models\WorkOrder\TicketProject;
32 use App\Models\WorkOrder\Tickets; 33 use App\Models\WorkOrder\Tickets;
33 use App\Services\AiBlogService; 34 use App\Services\AiBlogService;
34 use App\Services\CosService; 35 use App\Services\CosService;
@@ -113,16 +114,16 @@ class lyhDemo extends Command @@ -113,16 +114,16 @@ class lyhDemo extends Command
113 * @time :2025/7/22 15:14 114 * @time :2025/7/22 15:14
114 */ 115 */
115 public function _actionRoute(){ 116 public function _actionRoute(){
  117 + $ticketProjectModel = new TicketProject();
  118 + $ticList = $ticketProjectModel->list(['project_cate'=>2],['id','table_id']);
116 $projectModel = new Project(); 119 $projectModel = new Project();
117 - $lists = $projectModel->list([], 'id', ['id']);  
118 - $data = [];  
119 - foreach ($lists as $item){  
120 - echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL;  
121 - $letters = range('A', 'X'); // 只取前 24 个字母(A ~ X)  
122 - $randomLetter = $letters[array_rand($letters)];  
123 - $data['post_id'] = $randomLetter.mt_rand(100000, 999999).$item['id'];  
124 - $projectModel->edit(['post_id'=>$data['post_id']],['id'=>$item['id']]); 120 + foreach ($ticList as $item){
  121 + echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['table_id'] . PHP_EOL;
  122 + $post_id = 0;
  123 + $post_id = $projectModel->getValue(['id'=>$item['table_id']],'post_id');
  124 + $ticketProjectModel->edit(['post_id'=>$post_id], ['id'=>$item['id']]);
125 } 125 }
  126 +
126 return true; 127 return true;
127 } 128 }
128 129
@@ -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 + ],[
  30 + 'post_id.required' => 'post_id不能为空',
  31 + ]);
  32 + //查询是否有值
  33 + $project5CateModel = new Project5Cate();
  34 + $cateInfo = $project5CateModel->read(['project_id' => $this->param['post_id'],'updated_at'=>['>', date('Y-m-d H:i:s', strtotime('-48 hours'))]]);
  35 + if($cateInfo !== false){
  36 + $resultData = $cateInfo['text'];
  37 + $this->response('success', Code::SUCCESS, $resultData);
  38 + }
  39 + //获取域名
  40 + $ticketProjectMdoel = new TicketProject();
  41 + $projectInfo = $ticketProjectMdoel->read(['post_id' => $this->param['post_id']]);
  42 + if($projectInfo === false){
  43 + $this->response('当前项目不存在或数据未同步',Code::SYSTEM_ERROR);
  44 + }
  45 + $url = $projectInfo['website'].'/wp-admin/admin-ajax.php?action=get_products_category';
  46 + $data = http_get($url);
  47 + if($data && $data['status'] == 200){
  48 + $resultData = $data['data'];
  49 + $saveData = [
  50 + 'project_id' => $projectInfo['post_id'],
  51 + 'domain' => $projectInfo['domain'],
  52 + 'text'=>json_encode($data['data']),
  53 + ];
  54 + $project5CateModel->addReturnId($saveData);
  55 + $this->response('success', Code::SUCCESS,$resultData);
  56 + }
  57 + $this->response('success',Code::SUCCESS,$url);
  58 + }
  59 +}
@@ -4,7 +4,7 @@ namespace App\Http\Controllers\Aside\ProjectAssociation; @@ -4,7 +4,7 @@ namespace App\Http\Controllers\Aside\ProjectAssociation;
4 4
5 use App\Enums\Common\Code; 5 use App\Enums\Common\Code;
6 use App\Exceptions\BsideGlobalException; 6 use App\Exceptions\BsideGlobalException;
7 -use App\Http\Controllers\Bside\BaseController; 7 +use App\Http\Controllers\Aside\BaseController;
8 use App\Models\ProjectAssociation\ProjectAssociation; 8 use App\Models\ProjectAssociation\ProjectAssociation;
9 use App\Services\Aside\ProjectAssociation\ProjectAssociationServices; 9 use App\Services\Aside\ProjectAssociation\ProjectAssociationServices;
10 10
@@ -18,7 +18,7 @@ class ProjectAssociationController extends BaseController @@ -18,7 +18,7 @@ class ProjectAssociationController extends BaseController
18 */ 18 */
19 public function save() 19 public function save()
20 { 20 {
21 - $project_id = (int)request()->post('project_id', 0); 21 + $project_id = $this->param['project_id'] ?? 0;
22 if (empty($project_id)) { 22 if (empty($project_id)) {
23 $this->response('请选择项目!', Code::USER_PARAMS_ERROE); 23 $this->response('请选择项目!', Code::USER_PARAMS_ERROE);
24 } 24 }
@@ -48,7 +48,7 @@ class ProjectAssociationController extends BaseController @@ -48,7 +48,7 @@ class ProjectAssociationController extends BaseController
48 */ 48 */
49 public function check() 49 public function check()
50 { 50 {
51 - $project_id = (int)request()->input('project_id', 0); 51 + $project_id = $this->param['project_id'] ?? 0;
52 if (empty($project_id)) { 52 if (empty($project_id)) {
53 $this->response('请输入项目信息!', Code::SERVER_ERROR); 53 $this->response('请输入项目信息!', Code::SERVER_ERROR);
54 } 54 }
  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,6 +40,8 @@ class GeoConfirmLogic extends BaseLogic @@ -40,6 +40,8 @@ class GeoConfirmLogic extends BaseLogic
40 public function saveConfirmContent($param) 40 public function saveConfirmContent($param)
41 { 41 {
42 try { 42 try {
  43 + $wechat = $param['wechat'] ?? true;
  44 + unset($param['wechat']);
43 $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']]);
44 if($info === false){ 46 if($info === false){
45 $id = $this->model->addReturnId($param); 47 $id = $this->model->addReturnId($param);
@@ -51,11 +53,11 @@ class GeoConfirmLogic extends BaseLogic @@ -51,11 +53,11 @@ class GeoConfirmLogic extends BaseLogic
51 if (empty($friend)){ 53 if (empty($friend)){
52 $this->fail('项目未绑定微信群, 推送消息失败!'); 54 $this->fail('项目未绑定微信群, 推送消息失败!');
53 } 55 }
54 - GeoConfirm::sendConfirmMessage($id, $friend->friend_id); 56 + $data = GeoConfirm::sendConfirmMessage($id, $friend->friend_id,$wechat);
55 } catch (\Exception $e) { 57 } catch (\Exception $e) {
56 $this->fail('操作失败, error:' . $e->getMessage()); 58 $this->fail('操作失败, error:' . $e->getMessage());
57 } 59 }
58 - return $this->success(['id'=>$id]); 60 + return $this->success(['id'=>$id,'data'=>$data]);
59 } 61 }
60 62
61 /** 63 /**
@@ -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 }
@@ -106,7 +106,7 @@ class GeoConfirm extends Base @@ -106,7 +106,7 @@ class GeoConfirm extends Base
106 * @param $id 106 * @param $id
107 * @return bool 107 * @return bool
108 */ 108 */
109 - public static function sendConfirmMessage($id, $friend_id) 109 + public static function sendConfirmMessage($id, $friend_id,$send = true)
110 { 110 {
111 $data = self::where(compact('id'))->first(); 111 $data = self::where(compact('id'))->first();
112 $project_id = $data->project_id; 112 $project_id = $data->project_id;
@@ -127,13 +127,15 @@ class GeoConfirm extends Base @@ -127,13 +127,15 @@ class GeoConfirm extends Base
127 'url' => 'https://oa.quanqiusou.cn/public-geo-confirm?token=' . $token 127 'url' => 'https://oa.quanqiusou.cn/public-geo-confirm?token=' . $token
128 ]; 128 ];
129 $content = json_encode($content_array, JSON_UNESCAPED_UNICODE); 129 $content = json_encode($content_array, JSON_UNESCAPED_UNICODE);
130 - MessagePush::insert(compact('project_id', 'friend_id', 'type', 'content_type', 'content', 'send_time', 'updated_at', 'created_at')); 130 + if($send == true){
  131 + $data->send_at = now();
  132 + $data->status = self::STATUS_RUNNING;
  133 + MessagePush::insert(compact('project_id', 'friend_id', 'type', 'content_type', 'content', 'send_time', 'updated_at', 'created_at'));
  134 + }
131 // 消息推送, 更新数据 135 // 消息推送, 更新数据
132 $data->confirm = ''; 136 $data->confirm = '';
133 - $data->send_at = now();  
134 $data->uniqid = $token; 137 $data->uniqid = $token;
135 - $data->status = self::STATUS_RUNNING;  
136 $data->save(); 138 $data->save();
137 - return $data; 139 + return $content_array;
138 } 140 }
139 } 141 }
@@ -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 }
  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 +}
@@ -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 +