合并分支 'master-server' 到 'master'
Master server 查看合并请求 !659
正在显示
5 个修改的文件
包含
29 行增加
和
38 行删除
| @@ -32,12 +32,6 @@ class Kernel extends ConsoleKernel | @@ -32,12 +32,6 @@ class Kernel extends ConsoleKernel | ||
| 32 | $schedule->command('service_count')->dailyAt('01:00')->withoutOverlapping(1); //服务器使用情况,每天凌晨1点执行一次 | 32 | $schedule->command('service_count')->dailyAt('01:00')->withoutOverlapping(1); //服务器使用情况,每天凌晨1点执行一次 |
| 33 | $schedule->command('web_traffic_special')->everyMinute()->withoutOverlapping(1); // 特殊引流 | 33 | $schedule->command('web_traffic_special')->everyMinute()->withoutOverlapping(1); // 特殊引流 |
| 34 | $schedule->command('web_traffic_russia_special')->everyMinute()->withoutOverlapping(1); // 特殊引流 | 34 | $schedule->command('web_traffic_russia_special')->everyMinute()->withoutOverlapping(1); // 特殊引流 |
| 35 | -// $schedule->command('web_traffic 1')->everyThirtyMinutes(); // 引流 1-3个月的项目,半小时一次 | ||
| 36 | -// $schedule->command('web_traffic 2')->cron('*/18 * * * *'); // 引流 4-8个月的项目,18分钟一次 | ||
| 37 | -// $schedule->command('web_traffic 3')->cron('*/12 * * * *'); // 引流 大于9个月的项目,12分钟一次 | ||
| 38 | -// $schedule->command('web_traffic_russia 1')->everyThirtyMinutes(); // 俄语站引流 1-3个月的项目,半小时一次 | ||
| 39 | -// $schedule->command('web_traffic_russia 2')->cron('*/18 * * * *'); // 俄语站引流 4-8个月的项目,18分钟一次 | ||
| 40 | -// $schedule->command('web_traffic_russia 3')->cron('*/12 * * * *'); // 俄语站引流 大于9个月的项目,12分钟一次 | ||
| 41 | $schedule->command('sync_channel')->dailyAt('06:00')->withoutOverlapping(1); // 渠道信息,每天执行一次 | 35 | $schedule->command('sync_channel')->dailyAt('06:00')->withoutOverlapping(1); // 渠道信息,每天执行一次 |
| 42 | $schedule->command('forward_count')->monthlyOn(1,'01:00')->withoutOverlapping(1);//没月月初1号执行月统计转发询盘记录 | 36 | $schedule->command('forward_count')->monthlyOn(1,'01:00')->withoutOverlapping(1);//没月月初1号执行月统计转发询盘记录 |
| 43 | $schedule->command('inquiry_delay')->everyMinute()->withoutOverlapping(1);//TODO::上线放开,转发询盘,每分钟执行一次 | 37 | $schedule->command('inquiry_delay')->everyMinute()->withoutOverlapping(1);//TODO::上线放开,转发询盘,每分钟执行一次 |
| @@ -48,7 +42,6 @@ class Kernel extends ConsoleKernel | @@ -48,7 +42,6 @@ class Kernel extends ConsoleKernel | ||
| 48 | $schedule->command('sync_manager')->dailyAt('01:00')->withoutOverlapping(1); //TODO::手机号码同步 每天执行一次 | 42 | $schedule->command('sync_manager')->dailyAt('01:00')->withoutOverlapping(1); //TODO::手机号码同步 每天执行一次 |
| 49 | $schedule->command('update_keyword_route')->dailyAt('01:00')->withoutOverlapping(1); //升级项目--清除路由相同的关键字 | 43 | $schedule->command('update_keyword_route')->dailyAt('01:00')->withoutOverlapping(1); //升级项目--清除路由相同的关键字 |
| 50 | $schedule->command('recommended_suppliers')->dailyAt('03:00')->withoutOverlapping(1); //每天凌晨1点执行一次生成推荐商 | 44 | $schedule->command('recommended_suppliers')->dailyAt('03:00')->withoutOverlapping(1); //每天凌晨1点执行一次生成推荐商 |
| 51 | - | ||
| 52 | $schedule->command('update_keyword_content')->hourly()->withoutOverlapping(1); | 45 | $schedule->command('update_keyword_content')->hourly()->withoutOverlapping(1); |
| 53 | // 每日推送视频任务 | 46 | // 每日推送视频任务 |
| 54 | $schedule->command('video_task')->hourly()->withoutOverlapping(1); | 47 | $schedule->command('video_task')->hourly()->withoutOverlapping(1); |
| @@ -39,13 +39,6 @@ class ATemplateTypeController extends BaseController | @@ -39,13 +39,6 @@ class ATemplateTypeController extends BaseController | ||
| 39 | * @time :2023/7/10 15:49 | 39 | * @time :2023/7/10 15:49 |
| 40 | */ | 40 | */ |
| 41 | public function save(ATemplateTypeRequest $ATemplateTypeRequest,ATemplateTypeLogic $ATemplateTypeLogic){ | 41 | public function save(ATemplateTypeRequest $ATemplateTypeRequest,ATemplateTypeLogic $ATemplateTypeLogic){ |
| 42 | - if(isset($this->param['id']) && !empty($this->param['id'])){ | ||
| 43 | - $this->request->validate([ | ||
| 44 | - 'id'=>'required' | ||
| 45 | - ],[ | ||
| 46 | - 'id.required' => 'ID不能为空' | ||
| 47 | - ]); | ||
| 48 | - } | ||
| 49 | $ATemplateTypeRequest->validated(); | 42 | $ATemplateTypeRequest->validated(); |
| 50 | $ATemplateTypeLogic->typeSave(); | 43 | $ATemplateTypeLogic->typeSave(); |
| 51 | $this->response('success'); | 44 | $this->response('success'); |
| @@ -179,16 +179,15 @@ class BlogLogic extends BaseLogic | @@ -179,16 +179,15 @@ class BlogLogic extends BaseLogic | ||
| 179 | public function paramProcessing($param){ | 179 | public function paramProcessing($param){ |
| 180 | if(isset($this->param['id'])){ | 180 | if(isset($this->param['id'])){ |
| 181 | $param['operator_id'] = $this->user['id']; | 181 | $param['operator_id'] = $this->user['id']; |
| 182 | - if(isset($param['category_id']) && !empty($param['category_id'])){ | ||
| 183 | - $param['category_id'] = $this->getCategory($param['category_id']); | ||
| 184 | - } | ||
| 185 | }else{ | 182 | }else{ |
| 186 | $param['create_id'] = $this->user['id']; | 183 | $param['create_id'] = $this->user['id']; |
| 187 | $param['operator_id'] = $this->user['id']; | 184 | $param['operator_id'] = $this->user['id']; |
| 188 | $param['project_id'] = $this->user['project_id']; | 185 | $param['project_id'] = $this->user['project_id']; |
| 189 | - if(isset($param['category_id']) && !empty($param['category_id'])){ | ||
| 190 | - $param['category_id'] = $this->getCategory($param['category_id']); | ||
| 191 | - } | 186 | + } |
| 187 | + if(isset($param['category_id']) && !empty($param['category_id'])){ | ||
| 188 | + $param['category_id'] = $this->getCategory($param['category_id']); | ||
| 189 | + }else{ | ||
| 190 | + $param['category_id'] = ''; | ||
| 192 | } | 191 | } |
| 193 | return $this->success($param); | 192 | return $this->success($param); |
| 194 | } | 193 | } |
| @@ -201,11 +200,8 @@ class BlogLogic extends BaseLogic | @@ -201,11 +200,8 @@ class BlogLogic extends BaseLogic | ||
| 201 | * @time :2023/10/20 9:02 | 200 | * @time :2023/10/20 9:02 |
| 202 | */ | 201 | */ |
| 203 | public function getCategory($category){ | 202 | public function getCategory($category){ |
| 204 | - $str = ''; | ||
| 205 | - foreach ($category as $v){ | ||
| 206 | - $str .= $v.','; | ||
| 207 | - } | ||
| 208 | - return !empty(trim($str,',')) ? ','.$str.',' : ''; | 203 | + $str = implode(',',$category); |
| 204 | + return !empty(trim(trim($str,','),',')) ? ','.$str.',' : ''; | ||
| 209 | } | 205 | } |
| 210 | 206 | ||
| 211 | /** | 207 | /** |
| @@ -191,16 +191,15 @@ class NewsLogic extends BaseLogic | @@ -191,16 +191,15 @@ class NewsLogic extends BaseLogic | ||
| 191 | } | 191 | } |
| 192 | if(isset($this->param['id'])){ | 192 | if(isset($this->param['id'])){ |
| 193 | $param['operator_id'] = $this->user['id']; | 193 | $param['operator_id'] = $this->user['id']; |
| 194 | - if(isset($param['category_id']) && !empty($param['category_id'])){ | ||
| 195 | - $param['category_id'] = $this->getCategory($param['category_id']); | ||
| 196 | - } | ||
| 197 | }else{ | 194 | }else{ |
| 198 | $param['create_id'] = $this->user['id']; | 195 | $param['create_id'] = $this->user['id']; |
| 199 | $param['operator_id'] = $this->user['id']; | 196 | $param['operator_id'] = $this->user['id']; |
| 200 | $param['project_id'] = $this->user['project_id']; | 197 | $param['project_id'] = $this->user['project_id']; |
| 201 | - if(isset($param['category_id']) && !empty($param['category_id'])){ | ||
| 202 | - $param['category_id'] = $this->getCategory($param['category_id']); | ||
| 203 | - } | 198 | + } |
| 199 | + if(isset($param['category_id']) && !empty($param['category_id'])){ | ||
| 200 | + $param['category_id'] = $this->getCategory($param['category_id']); | ||
| 201 | + }else{ | ||
| 202 | + $param['category_id'] = ''; | ||
| 204 | } | 203 | } |
| 205 | return $this->success($param); | 204 | return $this->success($param); |
| 206 | } | 205 | } |
| @@ -213,11 +212,8 @@ class NewsLogic extends BaseLogic | @@ -213,11 +212,8 @@ class NewsLogic extends BaseLogic | ||
| 213 | * @time :2023/10/20 9:02 | 212 | * @time :2023/10/20 9:02 |
| 214 | */ | 213 | */ |
| 215 | public function getCategory($category){ | 214 | public function getCategory($category){ |
| 216 | - $str = ''; | ||
| 217 | - foreach ($category as $v){ | ||
| 218 | - $str .= $v.','; | ||
| 219 | - } | ||
| 220 | - return !empty(trim($str,',')) ? ','.$str.',' : ''; | 215 | + $str = implode(',',$category); |
| 216 | + return !empty(trim(trim($str,','),',')) ? ','.$str.',' : ''; | ||
| 221 | } | 217 | } |
| 222 | 218 | ||
| 223 | /** | 219 | /** |
| @@ -406,13 +406,26 @@ class ProductLogic extends BaseLogic | @@ -406,13 +406,26 @@ class ProductLogic extends BaseLogic | ||
| 406 | * @time :2023/8/9 10:17 | 406 | * @time :2023/8/9 10:17 |
| 407 | */ | 407 | */ |
| 408 | public function getStatusNumber(){ | 408 | public function getStatusNumber(){ |
| 409 | + $map = []; | ||
| 409 | //三种状态 0:草稿 1:发布 2:回收站 | 410 | //三种状态 0:草稿 1:发布 2:回收站 |
| 410 | $data = ['dra'=>0,'pub'=>1,'del'=>2,'tal'=>3]; | 411 | $data = ['dra'=>0,'pub'=>1,'del'=>2,'tal'=>3]; |
| 411 | foreach ($data as $k => $v){ | 412 | foreach ($data as $k => $v){ |
| 413 | + if(!isset($this->param['featured'])){ | ||
| 414 | + $cateModel = new Category(); | ||
| 415 | + $ids = $cateModel->where('title', 'not like', '%Featured%')->pluck('id')->toArray(); | ||
| 416 | + if(!empty($ids)){ | ||
| 417 | + $cateRelated = new CategoryRelated(); | ||
| 418 | + $product_ids = $cateRelated->whereIn('cate_id',$ids)->pluck('product_id')->toArray(); | ||
| 419 | + $map['id'] = ['in',$product_ids]; | ||
| 420 | + } | ||
| 421 | + }else{ | ||
| 422 | + $map['id'] = ['in',$ids]; | ||
| 423 | + } | ||
| 412 | if($v == 3){ | 424 | if($v == 3){ |
| 413 | - $data[$k] = $this->model->where(['project_id'=>$this->user['project_id']])->count(); | 425 | + $data[$k] = $this->model->formatQuery($map)->count(); |
| 414 | }else{ | 426 | }else{ |
| 415 | - $data[$k] = $this->model->where(['status'=>$v,'project_id'=>$this->user['project_id']])->count(); | 427 | + $map['status'] = $v; |
| 428 | + $data[$k] = $this->model->formatQuery($map)->count(); | ||
| 416 | } | 429 | } |
| 417 | } | 430 | } |
| 418 | return $this->success($data); | 431 | return $this->success($data); |
-
请 注册 或 登录 后发表评论