本文整理汇总了PHP中Illuminate\Database\Eloquent\Builder::whereXh方法的典型用法代码示例。如果您正苦于以下问题:PHP Builder::whereXh方法的具体用法?PHP Builder::whereXh怎么用?PHP Builder::whereXh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Database\Eloquent\Builder
的用法示例。
在下文中一共展示了Builder::whereXh方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: scopeStudiedCredits
/**
* 扩展查询,用于获取已修读学分
* @author FuRongxin
* @date 2016-01-23
* @version 2.0
* @param \Illuminate\Database\Eloquent\Builder $query 查询对象
* @param object $user 用户对象
* @return \Illuminate\Database\Eloquent\Builder 查询对象
*/
public function scopeStudiedCredits($query, $user)
{
return $query->whereXh($user->xh)->groupBy('pt', 'kcxz')->selectRaw('pt, kcxz, SUM(xf) AS xf');
}
示例2: scopeIsFresh
/**
* 扩展查询,用于查找学生是否是全日制本科新生
* @author FuRongxin
* @date 2016-02-22
* @version 2.0
* @param \Illuminate\Database\Eloquent\Builder $query 查询对象
* @param object $user 用户对象
* @return \Illuminate\Database\Eloquent\Builder 查询对象
*/
public function scopeIsFresh($query, $user)
{
return $query->whereXh($user->xh)->whereXjzt(config('constants.school.student'))->whereRaw('age(CURRENT_DATE, date_trunc(\'month\', rxrq)) < \'1 year\'')->where('xz', '<>', '2');
}
示例3: scopeMakeupScore
/**
* 扩展查询,用于获取学生综合成绩对应的补考成绩
* @author FuRongxin
* @date 2016-01-26
* @version 2.0
* @param \Illuminate\Database\Eloquent\Builder $query 查询对象
* @param object $user 用户对象
* @param string $kch 8位课程号
* @return \Illuminate\Database\Eloquent\Builder 查询对象
*/
public function scopeMakeupScore($query, $user, $kch)
{
$lstKcxh = Task::whereKch($kch)->distinct('kcxh')->lists('kcxh');
// 提交状态为3的成绩方可显示
return $query->whereXh($user->xh)->whereIn('kcxh', $lstKcxh)->whereTjzt(config('constants.score.dconfirmed'));
}
示例4: scopeStudied
/**
* 扩展查询,获取已修读课程列表
* @author FuRongxin
* @date 2016-03-10
* @version 2.0
* @param \Illuminate\Database\Eloquent\Builder $query 查询对象
* @param object $user 用户对象
* @return \Illuminate\Database\Eloquent\Builder 查询对象
*/
public function scopeStudied($query, $user)
{
return $query->whereXh($user->xh)->whereNotExists(function ($query) {
$query->from('xk_xkxx AS a')->whereNd(session('year'))->whereXq(session('term'))->whereRaw('t_a.xh = t_xk_xkxx.xh AND t_a.kcxh = t_xk_xkxx.kcxh');
});
}