作者 李宇航

合并分支 'master-server' 到 'master'

Master server



查看合并请求 !659
... ... @@ -32,12 +32,6 @@ class Kernel extends ConsoleKernel
$schedule->command('service_count')->dailyAt('01:00')->withoutOverlapping(1); //服务器使用情况,每天凌晨1点执行一次
$schedule->command('web_traffic_special')->everyMinute()->withoutOverlapping(1); // 特殊引流
$schedule->command('web_traffic_russia_special')->everyMinute()->withoutOverlapping(1); // 特殊引流
// $schedule->command('web_traffic 1')->everyThirtyMinutes(); // 引流 1-3个月的项目,半小时一次
// $schedule->command('web_traffic 2')->cron('*/18 * * * *'); // 引流 4-8个月的项目,18分钟一次
// $schedule->command('web_traffic 3')->cron('*/12 * * * *'); // 引流 大于9个月的项目,12分钟一次
// $schedule->command('web_traffic_russia 1')->everyThirtyMinutes(); // 俄语站引流 1-3个月的项目,半小时一次
// $schedule->command('web_traffic_russia 2')->cron('*/18 * * * *'); // 俄语站引流 4-8个月的项目,18分钟一次
// $schedule->command('web_traffic_russia 3')->cron('*/12 * * * *'); // 俄语站引流 大于9个月的项目,12分钟一次
$schedule->command('sync_channel')->dailyAt('06:00')->withoutOverlapping(1); // 渠道信息,每天执行一次
$schedule->command('forward_count')->monthlyOn(1,'01:00')->withoutOverlapping(1);//没月月初1号执行月统计转发询盘记录
$schedule->command('inquiry_delay')->everyMinute()->withoutOverlapping(1);//TODO::上线放开,转发询盘,每分钟执行一次
... ... @@ -48,7 +42,6 @@ class Kernel extends ConsoleKernel
$schedule->command('sync_manager')->dailyAt('01:00')->withoutOverlapping(1); //TODO::手机号码同步 每天执行一次
$schedule->command('update_keyword_route')->dailyAt('01:00')->withoutOverlapping(1); //升级项目--清除路由相同的关键字
$schedule->command('recommended_suppliers')->dailyAt('03:00')->withoutOverlapping(1); //每天凌晨1点执行一次生成推荐商
$schedule->command('update_keyword_content')->hourly()->withoutOverlapping(1);
// 每日推送视频任务
$schedule->command('video_task')->hourly()->withoutOverlapping(1);
... ...
... ... @@ -39,13 +39,6 @@ class ATemplateTypeController extends BaseController
* @time :2023/7/10 15:49
*/
public function save(ATemplateTypeRequest $ATemplateTypeRequest,ATemplateTypeLogic $ATemplateTypeLogic){
if(isset($this->param['id']) && !empty($this->param['id'])){
$this->request->validate([
'id'=>'required'
],[
'id.required' => 'ID不能为空'
]);
}
$ATemplateTypeRequest->validated();
$ATemplateTypeLogic->typeSave();
$this->response('success');
... ...
... ... @@ -179,16 +179,15 @@ class BlogLogic extends BaseLogic
public function paramProcessing($param){
if(isset($this->param['id'])){
$param['operator_id'] = $this->user['id'];
if(isset($param['category_id']) && !empty($param['category_id'])){
$param['category_id'] = $this->getCategory($param['category_id']);
}
}else{
$param['create_id'] = $this->user['id'];
$param['operator_id'] = $this->user['id'];
$param['project_id'] = $this->user['project_id'];
if(isset($param['category_id']) && !empty($param['category_id'])){
$param['category_id'] = $this->getCategory($param['category_id']);
}
}
if(isset($param['category_id']) && !empty($param['category_id'])){
$param['category_id'] = $this->getCategory($param['category_id']);
}else{
$param['category_id'] = '';
}
return $this->success($param);
}
... ... @@ -201,11 +200,8 @@ class BlogLogic extends BaseLogic
* @time :2023/10/20 9:02
*/
public function getCategory($category){
$str = '';
foreach ($category as $v){
$str .= $v.',';
}
return !empty(trim($str,',')) ? ','.$str.',' : '';
$str = implode(',',$category);
return !empty(trim(trim($str,','),',')) ? ','.$str.',' : '';
}
/**
... ...
... ... @@ -191,16 +191,15 @@ class NewsLogic extends BaseLogic
}
if(isset($this->param['id'])){
$param['operator_id'] = $this->user['id'];
if(isset($param['category_id']) && !empty($param['category_id'])){
$param['category_id'] = $this->getCategory($param['category_id']);
}
}else{
$param['create_id'] = $this->user['id'];
$param['operator_id'] = $this->user['id'];
$param['project_id'] = $this->user['project_id'];
if(isset($param['category_id']) && !empty($param['category_id'])){
$param['category_id'] = $this->getCategory($param['category_id']);
}
}
if(isset($param['category_id']) && !empty($param['category_id'])){
$param['category_id'] = $this->getCategory($param['category_id']);
}else{
$param['category_id'] = '';
}
return $this->success($param);
}
... ... @@ -213,11 +212,8 @@ class NewsLogic extends BaseLogic
* @time :2023/10/20 9:02
*/
public function getCategory($category){
$str = '';
foreach ($category as $v){
$str .= $v.',';
}
return !empty(trim($str,',')) ? ','.$str.',' : '';
$str = implode(',',$category);
return !empty(trim(trim($str,','),',')) ? ','.$str.',' : '';
}
/**
... ...
... ... @@ -406,13 +406,26 @@ class ProductLogic extends BaseLogic
* @time :2023/8/9 10:17
*/
public function getStatusNumber(){
$map = [];
//三种状态 0:草稿 1:发布 2:回收站
$data = ['dra'=>0,'pub'=>1,'del'=>2,'tal'=>3];
foreach ($data as $k => $v){
if(!isset($this->param['featured'])){
$cateModel = new Category();
$ids = $cateModel->where('title', 'not like', '%Featured%')->pluck('id')->toArray();
if(!empty($ids)){
$cateRelated = new CategoryRelated();
$product_ids = $cateRelated->whereIn('cate_id',$ids)->pluck('product_id')->toArray();
$map['id'] = ['in',$product_ids];
}
}else{
$map['id'] = ['in',$ids];
}
if($v == 3){
$data[$k] = $this->model->where(['project_id'=>$this->user['project_id']])->count();
$data[$k] = $this->model->formatQuery($map)->count();
}else{
$data[$k] = $this->model->where(['status'=>$v,'project_id'=>$this->user['project_id']])->count();
$map['status'] = $v;
$data[$k] = $this->model->formatQuery($map)->count();
}
}
return $this->success($data);
... ...