作者 刘锟

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

... ... @@ -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;
... ...
... ... @@ -29,6 +29,7 @@ use App\Models\WebSetting\Translate;
use App\Models\WebSetting\TranslateData;
use App\Models\WebSetting\WebSetting;
use App\Models\WorkOrder\TicketLog;
use App\Models\WorkOrder\TicketProject;
use App\Models\WorkOrder\Tickets;
use App\Services\AiBlogService;
use App\Services\CosService;
... ... @@ -113,16 +114,16 @@ class lyhDemo extends Command
* @time :2025/7/22 15:14
*/
public function _actionRoute(){
$ticketProjectModel = new TicketProject();
$ticList = $ticketProjectModel->list(['project_cate'=>2],['id','table_id']);
$projectModel = new Project();
$lists = $projectModel->list([], 'id', ['id']);
$data = [];
foreach ($lists as $item){
echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL;
$letters = range('A', 'X'); // 只取前 24 个字母(A ~ X)
$randomLetter = $letters[array_rand($letters)];
$data['post_id'] = $randomLetter.mt_rand(100000, 999999).$item['id'];
$projectModel->edit(['post_id'=>$data['post_id']],['id'=>$item['id']]);
foreach ($ticList as $item){
echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['table_id'] . PHP_EOL;
$post_id = 0;
$post_id = $projectModel->getValue(['id'=>$item['table_id']],'post_id');
$ticketProjectModel->edit(['post_id'=>$post_id], ['id'=>$item['id']]);
}
return true;
}
... ...
... ... @@ -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',
],[
'post_id.required' => 'post_id不能为空',
]);
//查询是否有值
$project5CateModel = new Project5Cate();
$cateInfo = $project5CateModel->read(['project_id' => $this->param['post_id'],'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);
}
$url = $projectInfo['website'].'/wp-admin/admin-ajax.php?action=get_products_category';
$data = http_get($url);
if($data && $data['status'] == 200){
$resultData = $data['data'];
$saveData = [
'project_id' => $projectInfo['post_id'],
'domain' => $projectInfo['domain'],
'text'=>json_encode($data['data']),
];
$project5CateModel->addReturnId($saveData);
$this->response('success', Code::SUCCESS,$resultData);
}
$this->response('success',Code::SUCCESS,$url);
}
}
... ...
... ... @@ -4,7 +4,7 @@ namespace App\Http\Controllers\Aside\ProjectAssociation;
use App\Enums\Common\Code;
use App\Exceptions\BsideGlobalException;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Controllers\Aside\BaseController;
use App\Models\ProjectAssociation\ProjectAssociation;
use App\Services\Aside\ProjectAssociation\ProjectAssociationServices;
... ... @@ -18,7 +18,7 @@ class ProjectAssociationController extends BaseController
*/
public function save()
{
$project_id = (int)request()->post('project_id', 0);
$project_id = $this->param['project_id'] ?? 0;
if (empty($project_id)) {
$this->response('请选择项目!', Code::USER_PARAMS_ERROE);
}
... ... @@ -48,7 +48,7 @@ class ProjectAssociationController extends BaseController
*/
public function check()
{
$project_id = (int)request()->input('project_id', 0);
$project_id = $this->param['project_id'] ?? 0;
if (empty($project_id)) {
$this->response('请输入项目信息!', Code::SERVER_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,6 +40,8 @@ class GeoConfirmLogic extends BaseLogic
public function saveConfirmContent($param)
{
try {
$wechat = $param['wechat'] ?? true;
unset($param['wechat']);
$info = $this->model->read(['project_id' => $param['project_id'],'type' => $param['type']]);
if($info === false){
$id = $this->model->addReturnId($param);
... ... @@ -51,11 +53,11 @@ class GeoConfirmLogic extends BaseLogic
if (empty($friend)){
$this->fail('项目未绑定微信群, 推送消息失败!');
}
GeoConfirm::sendConfirmMessage($id, $friend->friend_id);
$data = GeoConfirm::sendConfirmMessage($id, $friend->friend_id,$wechat);
} catch (\Exception $e) {
$this->fail('操作失败, error:' . $e->getMessage());
}
return $this->success(['id'=>$id]);
return $this->success(['id'=>$id,'data'=>$data]);
}
/**
... ...
... ... @@ -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;
}
}
... ...
... ... @@ -106,7 +106,7 @@ class GeoConfirm extends Base
* @param $id
* @return bool
*/
public static function sendConfirmMessage($id, $friend_id)
public static function sendConfirmMessage($id, $friend_id,$send = true)
{
$data = self::where(compact('id'))->first();
$project_id = $data->project_id;
... ... @@ -127,13 +127,15 @@ class GeoConfirm extends Base
'url' => 'https://oa.quanqiusou.cn/public-geo-confirm?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'));
if($send == true){
$data->send_at = now();
$data->status = self::STATUS_RUNNING;
MessagePush::insert(compact('project_id', 'friend_id', 'type', 'content_type', 'content', 'send_time', 'updated_at', 'created_at'));
}
// 消息推送, 更新数据
$data->confirm = '';
$data->send_at = now();
$data->uniqid = $token;
$data->status = self::STATUS_RUNNING;
$data->save();
return $data;
return $content_array;
}
}
... ...
... ... @@ -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;
}
}
... ...
... ... @@ -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');//确认文章信息
});
... ...