AR
Cache::tags(self::TAG)->set($key, $userId, self::TTL); через некоторое время записи удаляются, но остаются промежуточные записи... как от них избавиться?Size: a a a
AR
Cache::tags(self::TAG)->set($key, $userId, self::TTL); через некоторое время записи удаляются, но остаются промежуточные записи... как от них избавиться?ВС
ВС
А
ВС
ВС
А
А
ВС
А
А
С
CourseDay::query()
->withCount('goals')
->select(DB::raw('goals_count, week'))
->where('program_id', $tracker->course_day->program_id)
->where('day', '<>', '0')
->get();
als_count из метода withCount('goals_count’)count’ => 4],count’ => 3],s
CourseDay::query()
->withCount('goals')
->select(DB::raw('goals_count, week'))
->where('program_id', $tracker->course_day->program_id)
->where('day', '<>', '0')
->get();
als_count из метода withCount('goals_count’)count’ => 4],count’ => 3],С
SG
CourseDay::query()
->withCount('goals')
->select(DB::raw('goals_count, week'))
->where('program_id', $tracker->course_day->program_id)
->where('day', '<>', '0')
->get();
als_count из метода withCount('goals_count’)count’ => 4],count’ => 3],С
public function goals()
{
return $this->belongsToMany(Goal::class)
->using(CourseDayGoal::class)
->withPivot('order')
->withTimestamps();
}SG
public function goals()
{
return $this->belongsToMany(Goal::class)
->using(CourseDayGoal::class)
->withPivot('order')
->withTimestamps();
}CourseDay::query()
->selectRaw('course_days.week, count(goals.id) as goals_count')
->join('course_day_goal as pivot', 'course_days.id', 'pivot.course_day_id')
->join('goals', 'pivot.goal_id', 'goals.id')
->groupBy('course_days.week')
->get();SG
CourseDay::query()
->withCount('goals')
->select(DB::raw('goals_count, week'))
->where('program_id', $tracker->course_day->program_id)
->where('day', '<>', '0')
->get();
als_count из метода withCount('goals_count’)count’ => 4],count’ => 3],С
CourseDay::query()
->selectRaw('course_days.week, count(goals.id) as goals_count')
->join('course_day_goal as pivot', 'course_days.id', 'pivot.course_day_id')
->join('goals', 'pivot.goal_id', 'goals.id')
->groupBy('course_days.week')
->get();