|
@@ -2544,18 +2544,27 @@ class Member extends Model
|
|
|
if($check){
|
|
if($check){
|
|
|
$datas['clear_day'] = date('m月'.$signClearDay.'号', strtotime('next month'));
|
|
$datas['clear_day'] = date('m月'.$signClearDay.'号', strtotime('next month'));
|
|
|
$datas['clear_month'] = date('m月');
|
|
$datas['clear_month'] = date('m月');
|
|
|
|
|
+ // 签到后清除月份总消费
|
|
|
|
|
+ $totalCost = AccountLog::where(['user_id' => $userId, 'status' => 2, 'account_type' => 1, 'change_type' => 2])
|
|
|
|
|
+ ->where('created_at', '>=', $time)
|
|
|
|
|
+ ->sum('money');
|
|
|
|
|
+
|
|
|
|
|
+ $totalClearSign = AccountLog::where(['user_id' => $userId, 'type' => 12, 'status' => 2])
|
|
|
|
|
+ ->where('created_at', '>=', $time)
|
|
|
|
|
+ ->sum('money');
|
|
|
|
|
+ }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');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 签到后清除月份总消费
|
|
|
|
|
- $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);
|
|
$clearRedheart = ($totalClearSign - $totalCost);
|
|
|
$datas['sign_clear'] = $clearRedheart;
|
|
$datas['sign_clear'] = $clearRedheart;
|