Procházet zdrojové kódy

wesmiler 更新第5期更新代码合并

wesmiler před 4 roky
rodič
revize
b9e9a9a1cb
1 změnil soubory, kde provedl 15 přidání a 17 odebrání
  1. 15 17
      app/weixin/model/Member.php

+ 15 - 17
app/weixin/model/Member.php

@@ -2541,23 +2541,21 @@ class Member extends Model
             $check = AccountLog::where(['user_id' => $userId, 'type'=> 13, 'status' => 2])
                 ->where('created_at', '>=', $time)
                 ->find();
-            if(empty($check)){
-                $datas['show_clear'] = 0;
-            }else{
-                // 签到后清除月份总消费
-                $totalCost = AccountLog::where(['user_id' => $userId, 'status' => 2, 'account_type' => 1, 'change_type' => 2])
-                    ->where('created_at', '>=', $time)
-                    ->where('created_at', '<=', date('Y-m-01 01:00:00'))
-                    ->sum('money');
-
-                $totalClearSign = AccountLog::where(['user_id' => $userId, 'type' => 12, 'status' => 2])
-                    ->where('created_at', '>=', $time)
-                    ->where('created_at', '<=', date('Y-m-01 01:00:00'))
-                    ->sum('money');
-
-                $clearRedheart = ($totalClearSign - $totalCost);
-                $datas['sign_clear'] = $clearRedheart;
-            }
+
+            // 签到后清除月份总消费
+            $totalCost = AccountLog::where(['user_id' => $userId, 'status' => 2, 'account_type' => 1, 'change_type' => 2])
+                ->where('created_at', '>=', $time)
+                ->where('created_at', '<=', date('Y-m-01 01:00:00'))
+                ->sum('money');
+
+            $totalClearSign = AccountLog::where(['user_id' => $userId, 'type' => 12, 'status' => 2])
+                ->where('created_at', '>=', $time)
+                ->where('created_at', '<=', date('Y-m-01 01:00:00'))
+                ->sum('money');
+
+            $clearRedheart = ($totalClearSign - $totalCost);
+            $datas['sign_clear'] = $clearRedheart;
+
         }
 
         $totalSign = AccountLog::where(['user_id' => $userId, 'type' => 12, 'status' => 2])