作者 刘锟

update

... ... @@ -350,16 +350,28 @@ class GeoQuestionRes extends Command
$lock_key = 'geo_task_generation_lock';
$lock_ttl = 60; // 锁时间大于当前 锁功能执行时间
// 尝试获取锁,非阻塞方式
$lock = Redis::set($lock_key, 1, 'EX', $lock_ttl, 'NX');
if (empty($lock)){
// $lock = Redis::set($lock_key, 1, 'EX', $lock_ttl, 'NX');
$lock = Redis::get($lock_key);
if ($lock)
return $task_id;
}
$project_ids = GeoQuestion::where('status', GeoQuestion::STATUS_OPEN)->where('next_time', '<=', date('Y-m-d'))->pluck('project_id')->unique()->values()->toArray();
Redis::setex($lock_key, $lock_ttl, 1);
$project_ids = GeoQuestion::where('status', GeoQuestion::STATUS_OPEN)
->where(function ($query){
$query->where('next_time', '<=', date('Y-m-d'))
->orWhereNull('current_time')
->orWhereNull('next_time');
})
->pluck('project_id')
->unique()
->values()
->toArray();
if(FALSE == empty($project_ids)){
$ids = GeoQuestion::where('status', GeoQuestion::STATUS_OPEN)
->whereIn('project_id', $project_ids)
->where(function ($query){
$query->where('next_time', '<=', date('Y-m-d'))
$query->where('current_time', '<>', date('Y-m-d'))
->orWhereNull('current_time')
->orWhereNull('next_time');
})
->orderBy('next_time', 'asc')
... ...
... ... @@ -107,7 +107,7 @@ class GeoController extends BaseController
'keyword' => '项目数据确认',
'msg' =>
'cm:文章确认完成' . PHP_EOL .
'项目名称:'.$confInfo['company'] ?? '' . PHP_EOL .
'项目名称:'.($confInfo['company'] ?? '') . PHP_EOL .
'负责人:'.$manage_name . PHP_EOL,
'isAtAll' => false, // 是否@所有人
], 'https://oapi.dingtalk.com/robot/send?access_token=4effe85882009a8a1617dbeadc38c350f832deef7431ce10f5fda751b4c82fb9');
... ... @@ -176,7 +176,7 @@ class GeoController extends BaseController
'keyword' => '项目数据确认',
'msg' =>
'cm:'.(($info['type'] == 1) ? '标题确认' : '关键词确认'). PHP_EOL .
'项目名称:'.$confInfo['company'] ?? '' . PHP_EOL .
'项目名称:'.($confInfo['company'] ?? '') . PHP_EOL .
'负责人:'.$manage_name . PHP_EOL,
'isAtAll' => false, // 是否@所有人
], 'https://oapi.dingtalk.com/robot/send?access_token=4effe85882009a8a1617dbeadc38c350f832deef7431ce10f5fda751b4c82fb9');
... ...
... ... @@ -152,8 +152,12 @@ class ProjectController extends BaseController
if (isset($this->map['seo_plan']) && $this->map['seo_plan'] == 1) {
$query = $query->orderBy('gl_project.cooperate_date', 'desc')->orderBy('gl_project.id', 'desc');
} else {
if(isset($this->map['type']) && ($this->map['type'] == 1)){
$query = $query->orderBy('gl_project.id', 'desc');
}else{
$query = $query->orderBy('gl_project.uptime', 'desc')->orderBy('gl_project.id', 'desc');
}
}
return $query;
}
... ...
... ... @@ -285,6 +285,7 @@ class AsideTicketController extends BaseController
$ticket->plan_end_at = $request->input('plan_end_at', null);
$ticket->close_wechat = $request->input('close_wechat', false);
$ticket->num = $request->input('num', 0);
$ticket->is_user_look = $request->input('is_user_look',1);
$ticket->save();
// 分配工单参与人
$ticket->saveEngineers($request->input('engineer_ids', []));
... ... @@ -398,4 +399,23 @@ class AsideTicketController extends BaseController
$this->response('请先点击开关,打开微信推送', Code::USER_MODEL_NOTFOUND_ERROE);
$this->response('success', Code::SUCCESS);
}
/**
* @remark :获取工单类型
* @name :getorderTypeOptions
* @author :lyh
* @method :post
* @time :2025/11/24 15:38
*/
public function getorderTypeOptions()
{
$this->request->validate([
'project_cate'=>'required'
],[
'project_cate.required' => 'project_cate不能为空'
]);
$ticket = new Tickets();
$data = $ticket->getOrderTypeOptions($this->param['project_cate']);
$this->response('success', Code::SUCCESS, $data);
}
}
... ...
... ... @@ -104,17 +104,19 @@ class Extension3915ModuleController extends BaseController
],[
'module_id.required' => '模块id不能为空',
]);
if($this->user['project_id'] != 3915){
$this->fail('当前项目不能调用当前方法');
}
$moduleFieldModel = new ExtensionModuleField();
$filedList = $moduleFieldModel->where(['module_id' => $this->param['module_id']])->pluck('field_name', 'id')->toArray();
$filedList = $moduleFieldModel->where(['module_id' => $this->param['module_id']])->pluck( 'id','field_name')->toArray();
if(empty($filedList)){
$this->response('请先设置字段,再添加数据',Code::SUCCESS);
$this->fail('请先设置字段,再添加数据');
}
$data = $this->param;
$data = $this->param['data'];
$moduleValueModel = new ExtensionModuleValue();
//todo::优先截断表
$moduleValueModel->truncate();
$key_filedId = [];
$resultData = [];
try {
foreach ($data as $k => $v){
foreach ($v as $k1 => $v1){
if($k == 0){
... ... @@ -125,13 +127,20 @@ class Extension3915ModuleController extends BaseController
}
$resultData[] = [
'uuid'=>$k + 1,
'modile_id'=>$this->param['module_id'],
'module_id'=>$this->param['module_id'],
'field_id'=>$key_filedId[$k1],
'value'=>$v1 ?? '',
];
}
}
if(!empty($resultData)){
//todo::优先截断表
$moduleValueModel->truncate();
$moduleValueModel->insertAll($resultData);
}
}catch (\Exception $e){
$this->fail('当前文件不能导入,请修改后再导入');
}
$this->response('success',Code::SUCCESS,$resultData);
}
}
... ...
... ... @@ -765,10 +765,10 @@ class ImageController extends Controller
if($info === false){
$this->response('请先设置水印',Code::SYSTEM_ERROR);
}
if($info['status'] == 1 && empty($info['image_data'])){
if($this->param['status'] == 1 && empty($info['image_data'])){
$this->response('请先设置水印',Code::SYSTEM_ERROR);
}
if($info['status'] == 2 && empty($info['str_data'])){
if($this->param['status'] == 2 && empty($info['str_data'])){
$this->response('请先设置文字水印',Code::SYSTEM_ERROR);
}
$imageSetting->edit(['status'=>$this->param['status']],['project_id'=>$this->cache['project_id']]);
... ...
... ... @@ -9,7 +9,6 @@
namespace App\Http\Logic\Aside\Geo;
use App\Enums\Common\Code;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Geo\GeoConf;
use App\Models\Geo\GeoConfirm;
... ... @@ -43,7 +42,7 @@ class GeoConfirmLogic extends BaseLogic
public function saveConfirmContent($param)
{
try {
$wechat = $param['wechat'] ?? true;
$wechat = $param['wechat'] ?? 1;
unset($param['wechat']);
$info = $this->model->read(['project_id' => $param['project_id'],'type' => $param['type']]);
if($info === false){
... ... @@ -104,7 +103,7 @@ class GeoConfirmLogic extends BaseLogic
'keyword' => '项目数据确认',
'msg' =>
'cm:'.(($info['type'] == 1) ? '标题确认' : '关键词确认'). PHP_EOL .
'项目名称:'.$confInfo['company'] ?? '' . PHP_EOL .
'项目名称:'.($confInfo['company'] ?? '') . PHP_EOL .
'负责人:'.$manage_name . PHP_EOL,
'isAtAll' => false, // 是否@所有人
], 'https://oapi.dingtalk.com/robot/send?access_token=4effe85882009a8a1617dbeadc38c350f832deef7431ce10f5fda751b4c82fb9');
... ...
... ... @@ -84,23 +84,25 @@ class GeoQuestionLogic extends BaseLogic
*/
public function saveGeoQuestion(){
//处理数据
$max_num = 200;//最大数量
$count = count($this->param['question']);
$question = $this->param['question'];
$this->param['url'] = json_encode($this->param['url'] ?? [],true);
$this->param['keywords'] = json_encode($this->param['keywords'] ?? [],true);
if($count <= 20){
if(isset($this->param['id']) && !empty($this->param['id'])){
$id = $this->param['id'];
$this->model->edit($this->param,['id'=>$id]);
//编辑
$sum = $this->model->where('project_id',$this->param['project_id'])->where('id','!=',$this->param['id'])->sum('question_num') ?? 0;
}else{
$this->param['next_time'] = date('Y-m-d');
$id = $this->model->addReturnId($this->param);
//新增
$sum = $this->model->where('project_id',$this->param['project_id'])->sum('question_num') ?? 0;
}
return $this->success(['id'=>$id]);
}else{
if(($count + $sum) > $max_num){
$this->fail('当前问题数量大于最大数量200个问题,不允许保存');
}
$question = $this->param['question'];
$this->param['url'] = json_encode($this->param['url'] ?? [],true);
$this->param['keywords'] = json_encode($this->param['keywords'] ?? [],true);
$chunks = array_chunk($question, 20);
if(isset($this->param['id']) && !empty($this->param['id'])){
foreach ($chunks as $index => $chunk) {
$this->param['question_num'] = count($chunk);
$this->param['question'] = json_encode($chunk ?? [],true);
if($index == 0){
$id = $this->param['id'];
... ... @@ -113,12 +115,13 @@ class GeoQuestionLogic extends BaseLogic
}else{
$this->param['next_time'] = date('Y-m-d');
foreach ($chunks as $chunk) {
$this->param['question_num'] = count($chunk);
$this->param['question'] = json_encode($chunk ?? [],true);
$id = $this->model->addReturnId($this->param);
}
}
return $this->success(['id'=>$id]);
}
}
/**
... ...
... ... @@ -65,9 +65,11 @@ class GeoWritingsLogic extends BaseLogic
$this->param['status'] = GeoWritings::STATUS_INIT;
if(isset($this->param['id']) &&!empty($this->param['id'])){
$id = $this->param['id'];
$this->param['content_length'] = strlen($this->param['content'] ?? '');
$this->model->edit($this->param,['id'=>$id]);
}else{
$this->param['type'] = GeoWritings::TYPE_SUBMIT;
$this->param['content_length'] = strlen($this->param['content'] ?? '');
$this->param['uniqid'] = uniqid().$this->param['project_id'];
$id = $this->model->addReturnId($this->param);
}
... ... @@ -102,7 +104,7 @@ class GeoWritingsLogic extends BaseLogic
*/
public function sendWechatMessage()
{
$wechat = $this->param['wechat'] ?? true;
$wechat = $this->param['wechat'] ?? 1;
$this->model->edit(['status'=>2],['status'=>1,'project_id'=>$this->param['project_id']]);
$data = GeoWritings::sendConfirmMessage($this->param['project_id'],$wechat);
if($data === false){
... ...
... ... @@ -47,7 +47,7 @@ class GeoWritingsTaskRequest extends FormRequest
'title.required' => 'GEO文标题不能为空',
'title.max' => 'GEO文标题最多120个字符',
'command_introduction.required' => '生成引言内容命令不能为空',
'command_main.required' => '生成正文内容命令不能为空',
'command_main.required' => '生成正文内容命令不能为空'
];
}
}
... ...
... ... @@ -106,7 +106,7 @@ class GeoConfirm extends Base
* @param $id
* @return bool
*/
public static function sendConfirmMessage($id, $friend_id,$send = true)
public static function sendConfirmMessage($id, $friend_id,$send = 1)
{
$data = self::where(compact('id'))->first();
$project_id = $data->project_id;
... ... @@ -127,7 +127,7 @@ class GeoConfirm extends Base
'url' => 'https://oa.quanqiusou.cn/public-geo-confirm?token=' . $token
];
$content = json_encode($content_array, JSON_UNESCAPED_UNICODE);
if($send == true){
if($send){
$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'));
... ...
... ... @@ -77,7 +77,7 @@ class GeoWritings extends Base
* @return bool
* @throws \Exception
*/
public static function sendConfirmMessage($project_id,$wechat = true)
public static function sendConfirmMessage($project_id,$wechat = 1)
{
$friend = ProjectAssociation::where(['project_id' => $project_id])->first();
if (empty($friend)) {
... ...
... ... @@ -146,4 +146,29 @@ class Tickets extends Base
}
}
/**
* @remark :
* @name :getorderTypeOptions
* @author :lyh
* @method :post
* @time :2025/11/24 14:43
*/
public function getorderTypeOptions($project_cate = 1)
{
$data = [
'1' => ['资料上传', '美工设计', '网站修改', '优化问题', '优化报告', '网站同步', '页面翻译', '其他问题','关键词相关','上线审核','研发工单(客户不可见)'],
'2' => ['资料上传', '美工设计', '网站修改', '优化问题', '优化报告', '网站同步', '页面翻译', '其他问题','关键词相关','上线审核','GEO项目','研发工单(客户不可见)'],
'3' => ['功能问题', '操作问题', '数据问题', '功能需求', '培训需求', '其他问题','研发工单(客户不可见)'],
'4' => ['账号问题', '报告分析', '效果问题', '发帖问题', '视频问题', '美工设计', '其他问题','研发工单(客户不可见)']
];
$dataSon = [
'研发工单(客户不可见)'=>[
'1'=>[],
'2'=>[],
'3'=>[],
'4'=>[],
]
];
return ['type'=>$data[$project_cate], 'data'=>$dataSon['研发工单(客户不可见)'][$project_cate]];
}
}
... ...
... ... @@ -3,6 +3,7 @@
namespace App\Models\Workchat;
use App\Models\Base;
use App\Models\Domain\DomainInfo;
use App\Models\Inquiry\InquiryFormData;
use App\Models\Project\Project;
use App\Models\ProjectAssociation\ProjectAssociation;
... ... @@ -64,6 +65,9 @@ class MessagePush extends Base
return false;
}
$domain = DomainInfo::where(['project_id' => $project_id, 'status' => DomainInfo::STATUS_ONE])->value('domain');
$domain_message = $domain ?: '';
//特殊处理, 要求任何时候收到询盘都要及时推送到群里面
$special_project_ids = [650, 2045, 916, 3587, 568];
//9-21 点,每条消息及时通知
... ... @@ -75,7 +79,7 @@ class MessagePush extends Base
$model->friend_id = $friend_id;
$model->type = self::TYPE_INQUIRY;
$model->ref_ids = $id;
$model->content = '[' . date('H:i', strtotime($submit_at)) . '] 您的全球搜网站收到来自【' . $country . $name . '】的询盘信息,请登录后台或APP进行查看!';
$model->content = '[' . date('H:i', strtotime($submit_at)) . '] 您的全球搜网站' . $domain_message . '收到来自【' . $country . $name . '】的询盘信息,请登录后台或APP进行查看!';
$model->send_time = $submit_at;
}else{
//定时发送时间
... ... @@ -89,7 +93,7 @@ class MessagePush extends Base
$model->ref_ids = $id;
$model->countries = $country;
$model->send_time = $send_time;
$model->content = '[08:00] 您的全球搜网站收到来自【' . $country . $name . '】的询盘信息,请登录后台或APP进行查看!';
$model->content = '[08:00] 您的全球搜网站' . $domain_message . '收到来自【' . $country . $name . '】的询盘信息,请登录后台或APP进行查看!';
}else{
$ref_ids = explode(',', $model->ref_ids);
$ref_ids[] = $id;
... ... @@ -108,7 +112,7 @@ class MessagePush extends Base
$country = implode(',', $countries);
}
}
$model->content = '[08:00] 您的全球搜网站收到来自【' . $country . '】'.$count.'条询盘信息,请登录后台或APP进行查看!';
$model->content = '[08:00] 您的全球搜网站' . $domain_message . '收到来自【' . $country . '】'.$count.'条询盘信息,请登录后台或APP进行查看!';
}
}
$model->save();
... ...
... ... @@ -31,7 +31,7 @@ class DingService
public function handle(array $body, $link = '')
{
$link = $link ?: self::LINK;
$msgKey = mb_substr($body['msg'], 50);
$msgKey = mb_substr($body['msg'], 100);
if (!$this->getData(RedisKey::DING_MSG . $msgKey)) {
$arr = [
'msgtype' => 'text',
... ...
... ... @@ -325,6 +325,10 @@ class SyncSubmitTaskService
if($data['country'] == '新加坡' && $data['data']['referrer_url'] == 'https://www.google.com/' && $data['domain'] == 'www.dowellelectronic.com'){
throw new InquiryFilterException( '特殊过滤');
}
//来源是空的并且国家是德国 关杰 25/11/24
if($data['country'] == '德国' && empty($data['data']['referrer_url'])){
throw new InquiryFilterException( '特殊过滤');
}
$visit_data = $data['data'];
$referrer_url = '';
... ... @@ -508,7 +512,7 @@ class SyncSubmitTaskService
}
//新加坡 并且 没有来源信息的访问信息屏蔽了 海龙 25/10/21
if($data['country'] == '新加坡' && empty($data['referer'])){
if(in_array($data['country'], ['新加坡']) && empty($data['referer'])){
throw new InquiryFilterException( '全局过滤4');
}
... ...
... ... @@ -267,6 +267,8 @@ Route::middleware(['aloginauth'])->group(function () {
Route::get('/projects_team/{id}', [Aside\WorkOrder\TicketProjectController::class, 'team'])->name('admin.tickets.projects_team')->summary('A端工单项目团队');
Route::get('/v56_projects/list', [Aside\WorkOrder\AsideTicketController::class, 'projectList'])->name('admin.tickets.projectList')->summary('A端V5V6项目列表')
->description("project_cate[项目分类1]: 1 V5, 2 V6, 3 超迹, 4 域途");
Route::get('/v56_projects/getorderTypeOptions', [Aside\WorkOrder\AsideTicketController::class, 'getorderTypeOptions'])->name('admin.tickets.getorderTypeOptions')->summary('A端V5V6项目列表')
->description("工单类型");
Route::post('/log/{id}', [Aside\WorkOrder\AsideTicketLogController::class, 'update'])->name('admin.tickets.log.update')->summary('A端工单操作日志更新,完成工单');
Route::get('/chat/{ticket_id}', [Aside\WorkOrder\TicketChatController::class, 'index'])->name('admin.tickets.chat.index')->summary('A端工单聊天记录');
Route::post('/chat/{ticket_id}', [Aside\WorkOrder\TicketChatController::class, 'store'])->name('admin.tickets.chat.store')->summary('A端工单聊天记录创建');
... ...
... ... @@ -656,6 +656,9 @@ Route::middleware(['bloginauth'])->group(function () {
//2205项目单独处理
Route::any('2205/get2205List', [\App\Http\Controllers\Bside\ExtensionModule\Extension2205ModuleController::class, 'get2205List'])->name('extension_module_get2205List');
Route::any('2205/save2205Status', [\App\Http\Controllers\Bside\ExtensionModule\Extension2205ModuleController::class, 'save2205Status'])->name('extension_module_save2205Status');
//3915项目处理
Route::any('3915/lists', [\App\Http\Controllers\Bside\ExtensionModule\Extension3915ModuleController::class, 'lists'])->name('extension_module_3915_lists');
Route::any('3915/importData', [\App\Http\Controllers\Bside\ExtensionModule\Extension3915ModuleController::class, 'importData'])->name('extension_module_3915_importData');
});
//自定义小语种文本信息
... ...