作者 lyh

gxdemo脚本

@@ -177,4 +177,21 @@ class KeywordVideoController extends BaseController @@ -177,4 +177,21 @@ class KeywordVideoController extends BaseController
177 $data['end_total'] = $keywordModel->formatQuery(['status'=>1])->count(); 177 $data['end_total'] = $keywordModel->formatQuery(['status'=>1])->count();
178 $this->response('success',Code::SUCCESS,$data); 178 $this->response('success',Code::SUCCESS,$data);
179 } 179 }
  180 +
  181 + /**
  182 + * @remark :当月视频总数量
  183 + * @name :getVideoCount
  184 + * @author :lyh
  185 + * @method :post
  186 + * @time :2024/8/14 9:58
  187 + */
  188 + public function getVideoCount(){
  189 + // 当月的开始时间
  190 + $start_of_month = date("Y-m-01 00:00:00");
  191 + // 当月的结束时间:使用 strtotime() 计算最后一天
  192 + $end_of_month = date("Y-m-d 23:59:59", strtotime("last day of this month"));
  193 + $taskLogModel = new KeywordVideoTaskLog();
  194 + $count = $taskLogModel->formatQuery(['created_at'=>['between',[$start_of_month,$end_of_month]]])->count();
  195 + $this->response('success',Code::SUCCESS,['count'=>$count]);
  196 + }
180 } 197 }
@@ -351,6 +351,7 @@ Route::middleware(['aloginauth'])->group(function () { @@ -351,6 +351,7 @@ Route::middleware(['aloginauth'])->group(function () {
351 Route::any('/edit', [Aside\Com\KeywordVideoController::class, 'edit'])->name('keyword_video_edit'); 351 Route::any('/edit', [Aside\Com\KeywordVideoController::class, 'edit'])->name('keyword_video_edit');
352 Route::any('/getVideoTaskLog', [Aside\Com\KeywordVideoController::class, 'getVideoTaskLog'])->name('keyword_video_getVideoTaskLog'); 352 Route::any('/getVideoTaskLog', [Aside\Com\KeywordVideoController::class, 'getVideoTaskLog'])->name('keyword_video_getVideoTaskLog');
353 Route::any('/taskNum', [Aside\Com\KeywordVideoController::class, 'taskNum'])->name('keyword_video_taskNum'); 353 Route::any('/taskNum', [Aside\Com\KeywordVideoController::class, 'taskNum'])->name('keyword_video_taskNum');
  354 + Route::any('/getVideoCount', [Aside\Com\KeywordVideoController::class, 'getVideoCount'])->name('keyword_video_getVideoCount');
354 }); 355 });
355 356
356 // 公共主题模版 357 // 公共主题模版