one_after před 2 měsíci
rodič
revize
429ca3b01c
1 změnil soubory, kde provedl 4 přidání a 6 odebrání
  1. 4 6
      app/controller/UserController.php

+ 4 - 6
app/controller/UserController.php

@@ -427,14 +427,12 @@ class UserController
         $month_num          = date('t');
         $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++) {
             $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 . ' 23:59:59')
                 ->exists();