作者 刘锟

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

<?php
/**
* @remark :
* @name :UpdateHeartbeat.php
* @author :lyh
* @method :post
* @time :2024/8/28 15:13
*/
namespace App\Console\Commands\Update;
use App\Models\Log\OperationHeartbeat;
use Illuminate\Console\Command;
class UpdateHeartbeat extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'operation_heartbeat';
/**
* The console command description.
*
* @var string
*/
protected $description = '心跳半小时未操作更新为未操作';
/**
* @remark :更新半小时未操作的界面
* @name :handle
* @author :lyh
* @method :post
* @time :2024/8/28 15:25
*/
public function handle(){
$date = date('Y-m-d H:i:s',time() - 10 * 60);
$operationHeartbeatModel = new OperationHeartbeat();
$operationHeartbeatModel->edit(['status'=>0],['updated_at'=>['<=',$date]]);
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
return true;
}
}
... ... @@ -75,9 +75,15 @@ class OperationHeartbeatController extends BaseController
$condition = ['project_id'=>$this->user['project_id'],'source'=>$this->param['source'],'source_id'=>$this->param['source_id'],
'is_list'=>$this->param['is_list'],'is_custom'=>$this->param['is_custom'],'is_template'=>$this->param['is_template']];
$operationHeartbeatModel = new OperationHeartbeat();
$info = $operationHeartbeatModel->read($condition,['id','status']);
$info = $operationHeartbeatModel->read($condition,['id','status','updated_at']);
if($info === false){
$info = [];
}else{
$date_time = strtotime($info['updated_at']) + 7200;
if($date_time < time()){
$operationHeartbeatModel->edit(['status'=>0],$condition);
$info['status'] = 0;
}
}
$this->response('success',Code::SUCCESS,$info);
}
... ...
... ... @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside\Keyword;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Models\Project\DeployOptimize;
use App\Models\Project\MinorLanguages;
use App\Models\Project\ProjectKeyword;
class ProjectKeywordController extends BaseController
... ... @@ -35,11 +36,23 @@ class ProjectKeywordController extends BaseController
if($keywordInfo === false){
$data['search_keywords'] = '';
$data['customer_keywords'] = '';
$this->response('success',Code::SUCCESS,$data);
}
}else{
$data['search_keywords'] = $keywordInfo['search_keywords'];
$data['customer_keywords'] = $keywordInfo['customer_keywords'];
}
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :获取小语种关键词
* @name :minorKeyword
* @author :lyh
* @method :post
* @time :2024/9/20 17:49
*/
public function minorKeyword(){
$minorLanguageModel = new MinorLanguages();
$data = $minorLanguageModel->list(['project_id'=>$this->user['project_id']]);
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -774,4 +774,23 @@ class ProductController extends BaseController
];
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :批量设置产品
* @name :batchSetKeyword
* @author :lyh
* @method :post
* @time :2024/9/20 16:46
*/
public function batchSetKeyword(ProductLogic $logic){
$this->request->validate([
'id'=>'required|array',
'keyword_id'=>'required|array',
],[
'id.required' => '产品ID不能为空',
'category_id.required' => '关键词ID不能为空',
]);
$logic->batchSetKeyword();
$this->response('success');
}
}
... ...
... ... @@ -488,7 +488,6 @@ class ProjectLogic extends BaseLogic
* @date 2024/1/19
*/
public function saveInquiryFilterConfig($config){
//
$config['filter_countries'] = !empty($config['filter_countries']) ? Arr::lineToArray($config['filter_countries']) : json_encode([]);
$config['filter_contents'] = !empty($config['filter_contents']) ? Arr::lineToArray($config['filter_contents']) : json_encode([]);
$config['filter_referers'] = !empty($config['filter_referers']) ? Arr::lineToArray($config['filter_referers']) : json_encode([]);
... ... @@ -496,7 +495,6 @@ class ProjectLogic extends BaseLogic
$config['filter_mobiles'] = !empty($config['filter_mobiles']) ? Arr::lineToArray($config['filter_mobiles']) : json_encode([]);
$config['filter_names'] = !empty($config['filter_names']) ? Arr::lineToArray($config['filter_names']) : json_encode([]);
$config['black_ips'] = !empty($config['black_ips']) ? Arr::lineToArray($config['black_ips']) : json_encode([]);
$InquiryFilterConfigModel = new InquiryFilterConfig();
$info = $InquiryFilterConfigModel->read(['project_id'=>$config['project_id']]);
if($info === false){
... ...
... ... @@ -937,4 +937,17 @@ class ProductLogic extends BaseLogic
$this->model->edit(['keyword_id'=>null],['id'=>$this->param['id']]);
return $this->success(['id'=>$this->param['id']]);
}
/**
* @remark :批量设置产品关键词
* @name :batchSetKeyword
* @author :lyh
* @method :post
* @time :2024/9/20 16:48
*/
public function batchSetKeyword(){
$this->param['keyword_id'] = ','.implode(',',$this->param['keyword_id']).',';
$this->edit(['keyword_id'=>$this->param['keyword_id']],['id'=>['in',$this->param['id']]]);
return $this->success();
}
}
... ...
... ... @@ -13,6 +13,5 @@ use App\Models\Base;
class PhoneData extends Base
{
protected $connection = "custom_mysql";
protected $table = 'gl_phone_data';
}
... ...
... ... @@ -50,6 +50,15 @@ class SyncSubmitTaskService
return false;
}
//过滤url参数 清除全部参数
if($project['id'] == 1442 && !empty($data['data']['url'])){
$query = parse_url($data['data']['url'], PHP_URL_QUERY);
if($query){
$data['data']['url'] = str_replace('?'.$query, '', $data['data']['url']);
}
}
if(!ProjectServer::useProject($project['id'])){
return false;
}
... ...
... ... @@ -262,7 +262,8 @@ Route::middleware(['bloginauth'])->group(function () {
Route::any('/saveType', [\App\Http\Controllers\Bside\Product\ProductController::class, 'saveType'])->name('product_saveType');
Route::any('/delProductType', [\App\Http\Controllers\Bside\Product\ProductController::class, 'delProductType'])->name('product_delProductType');
Route::any('/getButton', [\App\Http\Controllers\Bside\Product\ProductController::class, 'getButton'])->name('product_getButton');
//产品分类
Route::any('/batchSetKeyword', [\App\Http\Controllers\Bside\Product\ProductController::class, 'batchSetKeyword'])->name('product_batchSetKeyword');
//产品分类batchSetKeyword
Route::get('category', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'index'])->name('product_category');
Route::get('category/info', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'info'])->name('product_category_info');
Route::any('category/categoryTopList', [\App\Http\Controllers\Bside\Product\CategoryController::class, 'categoryTopList'])->name('product_category_categoryTopList');
... ... @@ -506,6 +507,7 @@ Route::middleware(['bloginauth'])->group(function () {
//优化关键词,检索关键词
Route::prefix('project_keyword')->group(function () {
Route::any('/', [\App\Http\Controllers\Bside\Keyword\ProjectKeywordController::class, 'searchKeywords'])->name('searchKeywords');
Route::any('/minorKeyword', [\App\Http\Controllers\Bside\Keyword\ProjectKeywordController::class, 'minorKeyword'])->name('searchKeywords');
});
//自定义模板
Route::prefix('custom_module')->group(function () {
... ...