|
|
@@ -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])
|