$get_act = Db::field($field)
->table('yook_activity')
->where($wheresss)
->where('act_sign_end_time','gt',time())
->order("toptime desc")
->page($page, $limit)
->union(function ($query) use($wheresss, $field){
// d($wheresss);
$wheresss['act_sign_end_time'] = ['lt',time()];
$wheresss['act_start_time'] = ['gt',time()];
$wheresss['act_end_time'] = ['gt',time()];
$query->field($field)
->table('yook_activity')
->where($wheresss)
->order("toptime desc");
})
->union(function ($query) use ($wheresss, $field) {
$wheresss['act_end_time'] = ['lt',time()];
$query->field($field)
->table('yook_activity')
->where($wheresss)
->order("toptime desc");
})
->select();
网友评论