|
...
|
...
|
@@ -10,6 +10,8 @@ |
|
|
|
namespace App\Models\Com;
|
|
|
|
|
|
|
|
use App\Models\Base;
|
|
|
|
use Illuminate\Support\Carbon;
|
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
|
|
|
|
class KeywordVideoTaskLog extends Base
|
|
|
|
{
|
|
...
|
...
|
@@ -19,4 +21,26 @@ class KeywordVideoTaskLog extends Base |
|
|
|
const STATUS_ERROR = 3;
|
|
|
|
|
|
|
|
protected $table = 'gl_keyword_video_task_log';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取当月视频生成数量
|
|
|
|
* FIXME 混剪视频订阅计划 50000/m
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public static function getMonthVideoNum()
|
|
|
|
{
|
|
|
|
$key = 'video_keyword_number_month';
|
|
|
|
$num = Cache::get($key, function () use ($key) {
|
|
|
|
$this_day = date('d');
|
|
|
|
if($this_day >= 13) {
|
|
|
|
$start_date = Carbon::now()->day(13)->format('Y-m-d 00:00:00');
|
|
|
|
} else {
|
|
|
|
$start_date = Carbon::now()->subMonth()->day(13)->format('Y-m-d 00:00:00');
|
|
|
|
}
|
|
|
|
$num = self::where('created_at', '>', $start_date)->count();
|
|
|
|
Cache::put($key, $num, 1800);
|
|
|
|
return $num;
|
|
|
|
});
|
|
|
|
return $num;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|