|
@@ -427,14 +427,12 @@ class UserController
|
|
|
$month_num = date('t');
|
|
$month_num = date('t');
|
|
|
$res = [];
|
|
$res = [];
|
|
|
//查询当前用户当月签到记录
|
|
//查询当前用户当月签到记录
|
|
|
- $this_month_sign = Db::table('wa_stream')
|
|
|
|
|
- ->where('type', streamType2)
|
|
|
|
|
- ->where('user_id', $param['user_data']['id'])
|
|
|
|
|
- ->whereRaw("DATE_FORMAT(created_at,'%Y-%m')=?", date('Y-m'))
|
|
|
|
|
- ->get();
|
|
|
|
|
|
|
+
|
|
|
for ($i = 1; $i <= $month_num; $i++) {
|
|
for ($i = 1; $i <= $month_num; $i++) {
|
|
|
$date = $i > 9 ? date('Y-m-') . $i : date('Y-m-') . '0' . $i;
|
|
$date = $i > 9 ? date('Y-m-') . $i : date('Y-m-') . '0' . $i;
|
|
|
- $check_sign = collect($this_month_sign)
|
|
|
|
|
|
|
+ $check_sign = Db::table('wa_stream')
|
|
|
|
|
+ ->where('type', streamType2)
|
|
|
|
|
+ ->where('user_id', $param['user_data']['id'])
|
|
|
->where('created_at', '>=', $date . ' 00:00:00')
|
|
->where('created_at', '>=', $date . ' 00:00:00')
|
|
|
->where('created_at', '<=', $date . ' 23:59:59')
|
|
->where('created_at', '<=', $date . ' 23:59:59')
|
|
|
->exists();
|
|
->exists();
|