where('status', '<>', 3) ->count(); } /** * 创建“发布计划模块”基础查询。 * * 这里直接对齐 acgpmw 以下两个列表控制器的取数范围: * 1. `cron::cron_list()`:`project_id = 0 and status not in (9,10)` * 2. `ai_project_cron::cron_list()`:`project_id > 0` * * 小程序发布计划主页面只聚合这两类数据,避免把 `dy_video_cron` * 中其他业务模块(如 AI 文案等)的记录误当成发布计划展示出来。 * * @param int $userid 当前登录用户ID * @return Query */ public static function buildPublishPlanQuery(int $userid): Query { return self::where('userid', $userid) ->where(function (Query $query) { $query->where(function (Query $innerQuery) { $innerQuery->where('project_id', 0) ->whereNotIn('status', [9, 10]); })->whereOr(function (Query $innerQuery) { $innerQuery->where('project_id', '>', 0); }); }); } }