作者 lyh

gxdemo脚本

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