作者 zhl

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

... ... @@ -43,7 +43,7 @@ class RemainDay extends Command
* @var 暂停的项目
*/
protected $ceaseProjectId = [
354, 378, 649, 1226, 1283, 1703, 1893, 2066, 2250, 2193, 2399, 1685, 3931
354, 378, 649, 1226, 1283, 1703, 1893, 2066, 2250, 2193, 2399, 1685, 3931,2273,3647
];//需要单独处理的项目
/**
* The console command description.
... ...
... ... @@ -982,17 +982,17 @@ class RelayInquiry extends Command
$inquiry_date = Carbon::make($inquiry_date);
//当天的
if($inquiry_date->isToday()){
//广告投放日(周一、二、三) 第一封询盘100%及时推送
$is_first = false;
if(in_array($inquiry_date->weekday(), [1,2,3])) {
//广告投放日(周一、二、三、四) 第一封询盘100%及时推送
$is_timely = true; //是否及时推送
if(in_array($inquiry_date->weekday(), [1,2,3,4])) {
//是否今天的第一封询盘
$detail = ReInquiryDetail::where('re_website', $domain)->where('start_at', '>=', $inquiry_date->startOfDay()->toDatetimeString())->first();
if(!$detail){
$is_first = true;
if($detail){
$is_timely = false; //只有周一到周四的非第一封询盘 根据概率及时推送
}
}
//非广告投放日第一封询盘
if(!$is_first && $task->second_push_rate != 100){
//概率及时推送
if(!$is_timely && $task->second_push_rate != 100){
//按概率
$res = $this->get_rand([$task->second_push_rate, 100 - $task->second_push_rate]);
if($res == 1){
... ...
... ... @@ -21,8 +21,11 @@ use App\Models\Project\Payment;
use App\Models\Project\Project;
use App\Models\Project\ProjectAiSetting;
use App\Models\Project\ProjectWhiteHatAffix;
use App\Models\RouteMap\RouteMap;
use App\Models\Template\BTemplateMain;
use App\Models\Template\TemplateTypeMain;
use App\Models\WebSetting\Translate;
use App\Models\WebSetting\TranslateData;
use App\Models\WebSetting\WebSetting;
use App\Models\WorkOrder\TicketLog;
use App\Models\WorkOrder\Tickets;
... ... @@ -51,30 +54,7 @@ class lyhDemo extends Command
protected $description = '更新路由';
public function handle(){
$projectModel = new Payment();
$lists = $projectModel->list(['renewal_record'=>['not like','"expire_at": null']]);
foreach ($lists as $item){
foreach ($item['renewal_record'] as $key => $val){
if(!isset($val['end_time']) && !empty($val['expire_at'])){
$val['end_time'] = $val['expire_at'];
}
$item['renewal_record'][$key] = $val;
}
$projectModel->edit(['renewal_record'=>json_encode($item['renewal_record'],true)],['id'=>$item['id']]);
}
return true;
}
public function getExpectResult(){
$geo_service = new GeoService();
$question = 'Top AI Coffee Robot';
$answer = "Top AI Coffee Robot\" refers to advanced robotic systems that combine **precision automation, artificial intelligence, and specialty coffee expertise** to create high-quality beverages with minimal human intervention. Here's a breakdown of key features, leading examples, and benefits:\n\n### Core Features of Top AI Coffee Robots:\n1. **AI-Driven Customization** \n - Analyzes user preferences (strength, milk type, sweetness) via app profiles or voice commands. \n - Learns from feedback to refine future orders (e.g., \"less bitter than last time\"). \n2. **Robotic Precision Brewing** \n - Industrial arms handle grinding, tamping, steaming milk, and latte art with sub-millimeter accuracy. \n - Sensors monitor temperature, extraction time, and pressure for optimal flavor.";
$expect = "While I don't have specific information on the RobotAnno coffee machine, in general";
$str = "客户提出的问题:{$question},客户得到的回复:{$answer},客户需要预期:{$expect},请分析得到的回复和预期是否一致,仅回复我是或者否";
$data = $geo_service->getChatResult($str, 'gpt-4o-mini');
if(isset($data['text']) && $data['text'] == '是'){
}
return $this->translate_action();
}
/**
... ... @@ -257,9 +237,133 @@ class lyhDemo extends Command
echo "字段 $field 小写替换出错:" . $e->getMessage() . PHP_EOL;
}
}
echo '执行结束' . PHP_EOL;
DB::disconnect('custom_mysql');
}
public function translate_action()
{
ProjectServer::useProject(655);
$this->model = new Translate();
$lists = DB::connection('custom_mysql')->table('gl_translate_copy1')->where('url','!=','All')->get()->toArray();
foreach ($lists as $item) {
$item = (array)$item;
$sourceInfo = $this->getRouteSource($item['url']);
$info = $this->model->read(['language_id'=>$item['language_id'],'source_id'=>$sourceInfo['source_id'],'url'=>$item['url'],'project_id'=>655,'type'=>$item['type']]);
if($info === false){
$param = [
'type'=>$item['type'] ?? 1,
'project_id'=>655,
'url'=>$item['url'],
'language_id'=>$item['language_id'],
'alias'=>$item['alias'],
'source'=>$sourceInfo['source'],
'source_id'=>$sourceInfo['source_id'],
'is_list'=>$sourceInfo['is_list'],
'is_custom'=>$sourceInfo['is_custom'],
'page'=>$sendData['page'] ?? 0
];
$id = $this->model->addReturnId($param);
TranslateData::insert(['trans_id'=>$id,'data'=>$item['data']]);
}else{
TranslateData::where(['trans_id'=>$info['id']])->update(['data'=>$item['data']]);
}
}
DB::disconnect('custom_mysql');
}
public function getRouteSource($route){
$routes = $route;
$data = ['source'=>0,'source_id'=>0,'is_list'=>0,'is_custom'=>0,'page'=>0];
if(strtolower($route) == 'all'){
return $data;
}
if($route == 'index' || $route == '/'){
$data['source'] = 1;
return $data;
}
$route = basename($route);
$page = 0;
if (is_numeric($route)) {
$arr = explode('/',$routes);
$page = $route;
$route = $arr[0];
}
$routeModel = new RouteMap();
$routeInfo = $routeModel->read(['route'=>$route]);
if($routeInfo === false){
if(in_array($route,['products','news','blog'])){
//固定路由
$data['page'] = $page;
$data['is_list'] = 1;
if($route == 'products'){
$data['source'] = 2;
}elseif ($route == 'news'){
$data['source'] = 4;
}else{
$data['source'] = 3;
}
return $data;
}
return $data;
}
$data = $this->resultData($routeInfo,$data);
$data['page'] = $page;
return $data;
}
public function resultData($routeInfo,$data){
if($routeInfo['source'] == RouteMap::SOURCE_PAGE){
if($routeInfo['source_id']){
$data = ['source'=>9,'source_id'=>$routeInfo['source_id'],'is_list'=>0,'is_custom'=>0];
}
}
if($routeInfo['source'] == RouteMap::SOURCE_PRODUCT){
if($routeInfo['source_id']){
$data = ['source'=>2,'source_id'=>$routeInfo['source_id'],'is_list'=>0,'is_custom'=>0];
}
}
if($routeInfo['source'] == RouteMap::SOURCE_PRODUCT_CATE){
if($routeInfo['source_id']){
$data = ['source'=>2,'source_id'=>$routeInfo['source_id'],'is_list'=>1,'is_custom'=>0];
}
}
if($routeInfo['source'] == RouteMap::SOURCE_BLOG){
if($routeInfo['source_id']){
$data = ['source'=>3,'source_id'=>$routeInfo['source_id'],'is_list'=>0,'is_custom'=>0];
}
}
if($routeInfo['source'] == RouteMap::SOURCE_BLOG_CATE){
if($routeInfo['source_id']){
$data = ['source'=>3,'source_id'=>$routeInfo['source_id'],'is_list'=>1,'is_custom'=>0];
}
}
if($routeInfo['source'] == RouteMap::SOURCE_NEWS){
if($routeInfo['source_id']){
$data = ['source'=>4,'source_id'=>$routeInfo['source_id'],'is_list'=>0,'is_custom'=>0];
}
}
if($routeInfo['source'] == RouteMap::SOURCE_NEWS_CATE){
if($routeInfo['source_id']){
$data = ['source'=>4,'source_id'=>$routeInfo['source_id'],'is_list'=>1,'is_custom'=>0];
}
}
if($routeInfo['source'] == RouteMap::SOURCE_PRODUCT_KEYWORD){
if($routeInfo['source_id']){
$data = ['source'=>8,'source_id'=>$routeInfo['source_id'],'is_list'=>0,'is_custom'=>0];
}
}
if($routeInfo['source'] == RouteMap::SOURCE_MODULE){
if($routeInfo['source_id']){
$data = ['source'=>7,'source_id'=>$routeInfo['source_id'],'is_list'=>0,'is_custom'=>1];
}
}
if($routeInfo['source'] == RouteMap::SOURCE_MODULE_CATE){
if($routeInfo['source_id']){
$data = ['source'=>7,'source_id'=>$routeInfo['source_id'],'is_list'=>1,'is_custom'=>1];
}
}
return $data;
}
}
... ...
... ... @@ -97,7 +97,7 @@ class SyncSubmitTask extends Command
}
$task_info->save();
Log::channel('inquiry')->error($task_id . '处理失败', [$e->getMessage(), $e->getFile(), $e->getLine()]);
$this->output('任务失败:' . $e->getMessage());
$this->output('任务失败:' . $e->getMessage() . $e->getFile() . $e->getLine());
}
$use_time = time() - $time;
... ...
... ... @@ -245,4 +245,41 @@ class Arr extends \Illuminate\Support\Arr
}, $arr));
return json_encode(array_values(array_unique(array_filter($array))));
}
/**
* 数组转文本html数组
* @param $array
* @param $indentLevel
* @return array
* @author zbj
* @date 2025/9/26
*/
public static function formatForHtml($array, $indentLevel = 0) {
$result = [];
$indent = str_repeat('    ', $indentLevel);
foreach ($array as $key => $value) {
$isNumericKey = is_numeric($key);
if (is_array($value)) {
if (!$isNumericKey) {
$result[] = "{$indent}{$key}:<br/>";
$nestedResult = self::formatForHtml($value, $indentLevel + 1);
} else {
$key && $result[] = '<br/>';
$nestedResult = self::formatForHtml($value, $indentLevel);
}
$result = array_merge($result, $nestedResult);
} else {
if ($isNumericKey) {
$result[] = "{$indent}{$value}<br/>";
} else {
$result[] = "{$indent}{$key}: {$value}<br/>";
}
}
}
return $result;
}
}
... ...
... ... @@ -20,14 +20,83 @@ use Illuminate\Support\Facades\Cache;
*/
class BaseController extends Controller
{
public $param;
public $request;
protected $param = [];//所有请求参数
protected $token = ''; //token
protected $request = [];//助手函数
protected $page = 1;//当前页
protected $row = 20;//每页条数
protected $header = [];//设置请求头参数
protected $order = 'created_at';
protected $order_type = 'desc';
protected $map = [];//处理后的参数
public function __construct(Request $request)
{
$this->request = $request;
$this->param = $this->request->all();
$this->getParam();
}
/**
* @remark :请求参数处理
* @name :getParam
* @author :lyh
* @method :post
* @time :2023/6/17 16:34
*/
public function getParam(){
foreach ($this->param as $k => $v){
if(is_array($v)){
$this->map[$k] = $v;
}else{
$this->getMap($k,$v);
}
}
}
/**
* @remark :搜索参数处理
* @name :getMap
* @author :lyh
* @method :post
* @time :2023/8/28 10:22
*/
public function getMap($k,$v){
switch ($k){
case "order":
$this->order = $v;
break;
case "order_type":
$this->order_type = $v;
break;
case 'page':
$this->page = $v;
break;
case 'row':
case 'size':
$this->row = $v;
break;
case "name":
$this->map['name'] = ['like','%'.$v.'%'];
break;
case "start_at":
$this->_btw[0] = $v;
$this->_btw[1] = date('Y-m-d H:i:s',time());
$this->map['created_at'] = ['between', $this->_btw];
break;
case "end_at":
$this->_btw[1] = $v;
$this->map['created_at'] = ['between', $this->_btw];
break;
default:
if (!empty($v) || $v == 0) {
$this->map[$k] = $v;
}
break;
}
}
/**
* @param array $data
* @param string $message
... ...
<?php
/**
* @remark :
* @name :TicketUploadDataController.php
* @author :lyh
* @method :post
* @time :2025/9/25 09:40
*/
namespace App\Http\Controllers\Api\WorkOrder;
use App\Enums\Common\Code;
use App\Http\Controllers\Api\BaseController;
use App\Models\Blog\BlogCategory;
use App\Models\News\NewsCategory;
use App\Models\Product\Category;
use App\Models\Product\Keyword;
use App\Models\Ticket\TicketUploadData;
use App\Services\ProjectServer;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
/**
* @remark :上传产品/博客/新闻模块
* @name :TicketUploadDataController
* @author :lyh
* @method :post
* @time :2025/9/25 09:40
*/
class TicketUploadDataController extends BaseController
{
public function __construct(Request $request)
{
parent::__construct($request);
$this->model = new TicketUploadData();
}
/**
* @remark :已提交列表
* @name :lists
* @author :lyh
* @method :post
* @time :2025/9/25 10:28
*/
public function lists()
{
$this->request->validate([
'project_id' => 'required',
], [
'project_id.required' => 'project_id不能为空',
]);
$data = $this->model->lists($this->map, $this->page, $this->row, $this->order);
$this->response('success', Code::SUCCESS, $data);
}
/**
* @remark :获取数据详情
* @name :info
* @author :lyh
* @method :post
* @time :2025/9/25 10:35
*/
public function info()
{
$this->request->validate([
'id' => 'required',
], [
'id.required' => 'id不能为空',
]);
$data = $this->model->read($this->param);
$this->response('success', Code::SUCCESS, $data);
}
/**
* @remark :提交数据
* @name :save
* @author :lyh
* @method :post
* @time :2025/9/25 09:48
*/
public function save()
{
$this->request->validate([
'project_id' => 'required',
'type' => 'required',
'text' => 'required'
], [
'project_id.required' => 'project_id不能为空',
'type.required' => '上传类型不能为空',
'text' => '数据详情不为空'
]);
//验证当前数据是否已提交
$this->param['text'] = json_encode($this->param['text'], true);
$info = $this->model->read(['project_id' => $this->$this->param['project_id'], 'type' => $this->param['type'], 'text' => $this->param['text'], 'status' => 0]);
if ($info === false) {
$id = $this->model->addReturnId($this->param);
} else {
$id = $info['id'];
}
$data = ['id' => $id];
$this->response('success', Code::SUCCESS, $data);
}
/**
* @remark :根据项目获取分类
* @name :getProductCate
* @author :lyh
* @method :post
* @time :2025/9/25 15:41
*/
public function getProductCate()
{
$this->request->validate([
'project_id' => 'required',
'type' => 'required',
'search' => 'required'
], [
'project_id.required' => 'project_id不能为空',
'type.required' => 'type不能为空',
'search.required' => '搜索参数不能为空',
]);
ProjectServer::useProject($this->param['project_id']);
if ($this->param['type'] == 1) {
//todo::搜索获取分类
$productCateModel = new Category();
$data = $productCateModel->lists(['title' => ['like' => '%' . $this->param['search'] . '%']], 1, 20);
} else {
$keywordModel = new Keyword();
$data = $keywordModel->lists(['title' => ['like' => '%' . $this->param['search'] . '%']], 1, 20);
}
DB::disconnect('custom_mysql');
$this->response('success', Code::SUCCESS, $data);
}
/**
* @remark :获取博客分类
* @name :getBlogCate
* @author :lyh
* @method :post
* @time :2025/9/25 15:42
*/
public function getBlogCate()
{
$this->request->validate([
'project_id' => 'required',
'search' => 'required'
], [
'project_id.required' => 'project_id不能为空',
'search.required' => '搜索参数不能为空',
]);
ProjectServer::useProject($this->param['project_id']);
$blogCateModel = new BlogCategory();
$data = $blogCateModel->lists(['name' => ['like' => '%' . $this->param['search'] . '%']], 1, 20);
DB::disconnect('custom_mysql');
$this->response('success', Code::SUCCESS, $data);
}
/**
* @remark :获取新闻分类
* @name :getNewsCate
* @author :lyh
* @method :post
* @time :2025/9/25 15:43
*/
public function getNewsCate()
{
$this->request->validate([
'project_id' => 'required',
'search' => 'required'
], [
'project_id.required' => 'project_id不能为空',
'search.required' => '搜索参数不能为空',
]);
ProjectServer::useProject($this->param['project_id']);
$newsCateModel = new NewsCategory();
$data = $newsCateModel->lists(['name' => ['like' => '%' . $this->param['search'] . '%']], 1, 20);
DB::disconnect('custom_mysql');
$this->response('success', Code::SUCCESS, $data);
}
}
... ...
<?php
/**
* @remark :
* @name :TicketUploadDataController.php
* @author :lyh
* @method :post
* @time :2025/9/25 14:00
*/
namespace App\Http\Controllers\Aside\Ticket;
use App\Enums\Common\Code;
use App\Http\Controllers\Aside\BaseController;
use App\Http\Logic\Aside\Ticket\TicketUploadDataLogic;
use Illuminate\Http\Request;
/**
* @remark :工单上传列表审核功能
* @name :TicketUploadDataController
* @author :lyh
* @method :post
* @time :2025/9/25 14:01
*/
class TicketUploadDataController extends BaseController
{
public function __construct(Request $request)
{
parent::__construct($request);
$this->logic = new TicketUploadDataLogic();
}
/**
* @remark :获取审核列表
* @name :lists
* @author :lyh
* @method :post
* @time :2025/9/25 14:02
*/
public function lists(){
if(isset($this->map['text']) && !empty($this->map['text'])){
$this->map['text'] = ['like','%'.$this->map['text'].'%'];
}
$data = $this->logic->getDataList($this->map,$this->page,$this->row,$this->order);
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :获取数据详情
* @name :detail
* @author :lyh
* @method :post
* @time :2025/9/26 09:29
*/
public function detail(){
$this->request->validate([
'id'=>'required'
],[
'id.required' => '主键ID不能为空',
]);
$data = $this->logic->getDetail();
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :人工审核
* @name :save
* @author :lyh
* @method :post
* @time :2025/9/25 14:14
*/
public function save()
{
$this->request->validate([
'status'=>'required',
'id'=>'required'
],[
'status.required' => '提交状态不能为空',
'id.required' => '主键ID不能为空',
]);
$data = $this->logic->saveData();
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -155,8 +155,8 @@ class RankDataController extends BaseController
'cnt_first' => '排名第一',
'cnt_home' => '第一页',
'cnt_thirty' => '前三页',
'cnt_fifty' => '前五页',
'cnt_hundred' => '前十页',
// 'cnt_fifty' => '前五页',
// 'cnt_hundred' => '前十页',
'reach' => '是否达标',
];
}
... ...
<?php
/**
* @remark :
* @name :TicketUploadDataLogic.php
* @author :lyh
* @method :post
* @time :2025/9/25 14:03
*/
namespace App\Http\Logic\Aside\Ticket;
use App\Helper\Arr;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Blog\Blog;
use App\Models\News\News;
use App\Models\Product\CategoryRelated;
use App\Models\Product\KeywordRelated;
use App\Models\Product\Product;
use App\Models\RouteMap\RouteMap;
use App\Models\Ticket\TicketUploadData;
use App\Services\ProjectServer;
use Illuminate\Support\Facades\DB;
class TicketUploadDataLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->param = $this->requestAll;
$this->model = new TicketUploadData();
}
/**
* @remark :获取审核列表
* @name :getDataList
* @author :lyh
* @method :post
* @time :2025/9/25 14:17
*/
public function getDataList($map = [],$page = 1,$row = 20,$order = 'id'){
if(isset($this->map['text']) && !empty($this->map['text'])){
$this->map['text'] = ['like','%'.$this->map['text'].'%'];
}
$data = $this->model->lists($map,$page,$row,$order);
foreach ($data as &$v){
$v = $this->getHandleFileImage($v);
}
return $this->success($data);
}
/**
* @remark :处理数据
* @name :getHandleFileImage
* @author :lyh
* @method :post
* @time :2025/9/25 16:53
*/
public function getHandleFileImage($v){
if($v['type'] == 1){
if(!empty($v['text']['image'])){
foreach ($v['text']['image'] as $gallery_k => $gallery_v){
$gallery_v['url'] = getImageUrl($gallery_v['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
$info['text']['image'][$gallery_k] = $gallery_v;
}
}
}else{
$v['text']['image'] = getImageUrl($v['text']['image'],$this->user['storage_type'],$this->user['project_location']);
}
return $this->success($v);
}
/**
* @remark :获取当前数据详情
* @name :getDetail
* @author :lyh
* @method :post
* @time :2025/9/26 09:31
*/
public function getDetail(){
$info = $this->model->read(['id'=>$this->param['id']]);
if($info === false){
$this->fail('当前数据不存在或已被删除');
}
$info = $this->getHandleFileImage($info);
return $this->success($info);
}
/**
* @remark :保存数据
* @name :saveData
* @author :lyh
* @method :post
* @time :2025/9/25 17:01
*/
public function saveData()
{
//获取当前数据详情
$info = $this->model->read(['id'=>$this->param['id']]);
if($info === false){
$this->fail('当前数据不存在或已被删除');
}
//审核成功执行
if($this->param['status'] == 1){
ProjectServer::useProject($info['project_id']);
if($info['type'] == 1){
$this->saveProductData($info);
}elseif ($info['type'] == 2){
$this->saveBlogData($info);
}else{
$this->saveNewsData($info);
}
DB::disconnect('custom_mysql');
}
$data = $this->model->edit(['status'=>$this->param['status'],'operator_id'=>$this->manager['id'],'remark'=>$this->param['remark'] ?? ''],['id'=>$this->param['id']]);
return $this->success($data);
}
/**
* @remark :保存数据详情
* @name :saveData
* @author :lyh
* @method :post
* @time :2025/9/25 14:17
*/
public function saveProductData($info){
if(isset($info['text']['keyword_id']) && !empty($info['text']['keyword_id'])){
$keyword_id = ','.Arr::arrToSet($info['text']['keyword_id']).',';
}
if(isset($info['text']['category_id']) && !empty($info['text']['category_id'])) {
$category_id = ','.Arr::arrToSet($info['text']['category_id']).',';
}
if(isset($info['text']['image']) && !empty($info['text']['image'])){
foreach ($info['text']['image'] as $k => $v){
$v['url'] = str_replace_url($v['url']);
$info['text']['image'][$k] = $v;
}
$info['text']['image'] = Arr::a2s($info['text']['image'] ?? []);
}else{
$info['text']['image'] = Arr::a2s([]);
}
try {
$productModel = new Product();
$data = [
'project_id' => $info['project_id'],
'title' => $info['text']['title'],
'thumb'=>json_encode($info['text']['image'][0] ?? [],true),
'gallery'=>json_encode($info['text']['image'] ?? [],true),
'intro'=>$info['text']['remark'],
'category_id'=>$category_id ?? '',
'keyword_id'=>$keyword_id ?? '',
'status'=>0,
];
$id = $productModel->addReturnId($data);
CategoryRelated::saveRelated($id, $info['text']['category_id'] ?? []);//分类关联
KeywordRelated::saveRelated($id,$info['text']['keyword_id'] ?? []);//关键字关联
$route = RouteMap::setRoute($data['title'],RouteMap::SOURCE_PRODUCT,$id,$info['project_id']);
$this->model->edit(['route'=>$route],['id'=>$id]);
}catch (\Exception $e){
$this->fail('保存失败,请联系管理员');
}
return $this->success();
}
/**
* @remark :保存blog数据
* @name :saveBlogData
* @author :lyh
* @method :post
* @time :2025/9/25 16:26
*/
public function saveBlogData($info)
{
if(isset($info['text']['category_id']) && !empty($info['text']['category_id'])) {
$category_id = ','.Arr::arrToSet($info['text']['category_id']).',';
}
if(isset($info['text']['image'])){
$info['text']['image'] = str_replace_url($info['text']['image'] ?? '');
}
$data = [
'project_id' => $info['project_id'],
'name' => $info['text']['title'],
'image'=>$info['text']['image'],
'text'=>$info['text']['remark'],
'category_id'=>$category_id ?? '',
'status'=>0,
];
try {
$blogModel = new Blog();
$id = $blogModel->addReturnId($data);
$route = RouteMap::setRoute($data['name'],RouteMap::SOURCE_BLOG,$id,$info['project_id']);
$this->model->edit(['url'=>$route],['id'=>$id]);
}catch (\Exception $e){
$this->fail('保存失败,请联系管理员');
}
return $this->success();
}
/**
* @remark :保存新闻数据
* @name :saveNewsData
* @author :lyh
* @method :post
* @time :2025/9/25 16:34
*/
public function saveNewsData($info)
{
if(isset($info['text']['category_id']) && !empty($info['text']['category_id'])) {
$category_id = ','.Arr::arrToSet($info['text']['category_id']).',';
}
if(isset($info['text']['image'])){
$info['text']['image'] = str_replace_url($info['text']['image'] ?? '');
}
$data = [
'project_id' => $info['project_id'],
'name' => $info['text']['title'],
'image'=>$info['text']['image'],
'text'=>$info['text']['remark'],
'category_id'=>$category_id ?? '',
'status'=>0,
];
try {
$newsModel = new News();
$id = $newsModel->addReturnId($data);
$route = RouteMap::setRoute($data['name'],RouteMap::SOURCE_NEWS,$id,$info['project_id']);
$this->model->edit(['route'=>$route],['id'=>$id]);
}catch (\Exception $e){
$this->fail('保存失败,请联系管理员');
}
return $this->success();
}
}
... ...
... ... @@ -48,7 +48,7 @@ class CountLogic extends BaseLogic
$domain = parse_url($this->user['domain'], PHP_URL_HOST); // 直接取域名部分
$inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$this->user['is_upgrade']);
if($inquiry_list !== false){
if($inquiry_list['status'] != 400){
if(isset($inquiry_list['status']) && $inquiry_list['status'] != 400){
$info['inquiry_num'] = $inquiry_list['data']['count'];
Cache::add('inquiry_num_'.$this->user['project_id'],$inquiry_list['data']['count'],3600);
}
... ...
... ... @@ -555,7 +555,7 @@ class RankDataLogic extends BaseLogic
$without_extension_project_ids = [658]; //是否达标只统计主词的
$extension_project_ids = [354]; //扩展词也到达标的
$compliance_project_ids = [2163,257,823,1750,497]; //直接达标处理的
$ceaseProjectId = [354, 378, 649, 1226, 1283, 1703, 1893, 2066, 2250,2193,2399,1685, 3931];//暂停的项目
$ceaseProjectId = [354, 378, 649, 1226, 1283, 1703, 1893, 2066, 2250,2193,2399,1685, 3931,2273,3647];//暂停的项目
$uptimeProjectId = [1434,1812,276,2414,2974];//按上线时间统计的项目
//一个项目多个api_no
$multiple_api_no_project_ids = [
... ...
... ... @@ -2,6 +2,7 @@
namespace App\Models\Inquiry;
use App\Helper\Arr;
use App\Helper\FormGlobalsoApi;
use App\Models\Base;
use App\Utils\LogUtils;
... ... @@ -83,6 +84,12 @@ class InquiryFormData extends Base
$v = getImageUrl($v['path']);
$data[$k] = $v;
}
if(is_string($v)){
$arr = json_decode($v, true);
if(is_array($arr)){
$v = implode('', Arr::formatForHtml($arr));
}
}
//其他字段补充到message里
if(!in_array($k, ['name', 'email', 'message', 'phone', 'ip', 'date', 'cname', 'domain', 'edition', 'domain_host_url'])){
$data['message'].= "<br/>" . $k .': ' . $v;
... ...
... ... @@ -9,6 +9,7 @@ use App\Models\Base;
use App\Models\Domain\DomainInfo;
use App\Models\Project\Project;
use App\Models\Task\TaskOwner;
use App\Services\DingService;
use App\Utils\HttpUtils;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Cache;
... ... @@ -68,6 +69,18 @@ class ReInquiryCount extends Base
$model->task_ids = $model->task_ids + [$task_id];
$model->num = $model->num + $num;
$model->save();
//数量首次达到100, 给钉钉推送消息
if($num > 0 && $model->num == 100){
(new DingService())->handle([
'keyword' => '询盘数量通知',
'msg' =>
'项目名称:' . $model->company . PHP_EOL .
'项目域名:' . $model->domain . PHP_EOL .
'询盘数量:' . $model->num,
'isAtAll' => false, // 是否@所有人
], 'https://oapi.dingtalk.com/robot/send?access_token=cd5733d3e6b810a501e3ea20df7c99ecb616aa6754fa048348837d088c1f5b2c');
}
}
public function setTaskIdsAttribute($value)
... ...
<?php
/**
* @remark :
* @name :TicketUploadData.php
* @author :lyh
* @method :post
* @time :2025/9/25 09:33
*/
namespace App\Models\Ticket;
use App\Helper\Arr;
use App\Models\Base;
/**
* @remark :工单内上传数据
* @name :TicketUploadData
* @author :lyh
* @method :post
* @time :2025/9/25 09:34
*/
class TicketUploadData extends Base
{
protected $table = 'gl_ticket_upload_data';
public function getTextAttribute($value){
if(!empty($value)){
$value = Arr::s2a($value);
}
return $value;
}
}
... ...
... ... @@ -94,3 +94,13 @@ Route::prefix('tickets')->group(function () {
});
Route::any('/get_project_records', [\App\Http\Controllers\Api\WorkOrder\TicketController::class, 'get_project_records'])->name('tickets.get_project_records');
Route::get('/pushTicketByBot/{friend_id}', [\App\Http\Controllers\Api\WorkOrder\TicketController::class, 'pushTicketByBot'])->summary('企微群@机器人触发工单推送')->name('tickets.pushTicketByBot');
//保存工单提交数据(产品,新闻,博客)详情
Route::prefix('ticket_upload')->group(function () {
Route::any('/', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'lists'])->name('ticket_upload.lists');
Route::any('/info', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'info'])->name('ticket_upload.info');
Route::any('/save', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'save'])->name('ticket_upload.save');
Route::any('/getProductCate', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'getProductCate'])->name('ticket_upload.getProductCate');
Route::any('/getBlogCate', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'getBlogCate'])->name('ticket_upload.getBlogCate');
Route::any('/getNewsCate', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'getNewsCate'])->name('ticket_upload.getNewsCate');
});
... ...
... ... @@ -644,6 +644,12 @@ Route::middleware(['aloginauth'])->group(function () {
Route::any('/monthManageList', [\App\Http\Controllers\Aside\Ticket\TicketController::class,'monthManageList'])->name('ticket_count_monthManageList');//月统计数据
Route::any('/manageTicketCount', [\App\Http\Controllers\Aside\Ticket\TicketController::class,'manageTicketCount'])->name('ticket_count_manageTicketCount');
});
//ticket
Route::prefix('ticket_upload')->group(function () {
Route::any('/', [Aside\Ticket\TicketUploadDataController::class,'lists'])->name('ticket_upload_lists');
Route::any('/save', [Aside\Ticket\TicketUploadDataController::class,'save'])->name('ticket_upload_save');
Route::any('/detail', [Aside\Ticket\TicketUploadDataController::class,'detail'])->name('ticket_upload_detail');
});
});
//无需登录验证的路由组
... ...