瀏覽代碼

会员部分修改

shensong 5 年之前
父節點
當前提交
0c55ede161
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/CustomerGiftReceives.php

+ 2 - 2
app/CustomerGiftReceives.php

@@ -37,7 +37,7 @@ class CustomerGiftReceives extends Model
37 37
             $times++;
38 38
             #判断现在距离会员结束还有几个月,最后一个月不算
39 39
             $start = new \DateTime(date('Y-m-d',time()));
40
-            $end =  new \DateTime($endTime);
40
+            $end =  new \DateTime(date('Y-m-d',strtotime($endTime.' -1 day')));
41 41
             $diff = $start->diff($end);
42 42
             $diff_month = $diff->format('%y')*12+$diff->format('%m');
43 43
             $times += $diff_month;
@@ -45,7 +45,7 @@ class CustomerGiftReceives extends Model
45 45
         } else {
46 46
             #判断现在距离会员结束还有几个月,最后一个月不算
47 47
             $start = new \DateTime(date('Y-m-d',time()));
48
-            $end =  new \DateTime($endTime);
48
+            $end =  new \DateTime(date('Y-m-d',strtotime($endTime.' -1 day')));
49 49
             $diff = $start->diff($end);
50 50
             $diff_month = $diff->format('%y')*12+$diff->format('%m');
51 51
             $times += $diff_month;