Browse Source

运算符号加括号

lizhen_gitee 4 months ago
parent
commit
8e2869ce3b
1 changed files with 11 additions and 11 deletions
  1. 11 11
      application/index/controller/Plantask.php

+ 11 - 11
application/index/controller/Plantask.php

@@ -450,8 +450,8 @@ class Plantask extends Controller
         }
 
         //先查找 下周有没有数据
-        $starttime = strtotime('this week Monday') + 86400*7;
-        $endtime   = $starttime + 86400*7;
+        $starttime = strtotime('this week Monday') + (86400*7);
+        $endtime   = $starttime + (86400*7);
         $check = Db::name('lesson_slot')->where('starttime','BETWEEN',[$starttime,$endtime])->find();
         if($check){
             echo '下周有数据了';
@@ -461,8 +461,8 @@ class Plantask extends Controller
         echo '准备复制';
         //拿上周,复制到下周
 
-        $starttime = strtotime('this week Monday') - 86400*7; // 获取本周一的时间戳
-        $endtime   = $starttime + 86400*7;
+        $starttime = strtotime('this week Monday') - (86400*7); // 获取本周一的时间戳
+        $endtime   = $starttime + (86400*7);
 
         $list = Db::name('lesson_slot')->where('is_show',1)->where('starttime','BETWEEN',[$starttime,$endtime])->order('starttime asc')->select();
         if(empty($list)){
@@ -472,8 +472,8 @@ class Plantask extends Controller
 
         foreach($list as $key => &$val){
             unset($val['id']);
-            $val['starttime'] = $val['starttime'] + 86400*14;
-            $val['endtime']   = $val['endtime'] + 86400*14;
+            $val['starttime'] = $val['starttime'] + (86400*14);
+            $val['endtime']   = $val['endtime'] + (86400*14);
             $val['bookednum'] = 0;
             $val['status'] = 0;
             $val['notice_status'] = 0;
@@ -510,8 +510,8 @@ class Plantask extends Controller
         }
 
         //先查找 下周有没有数据
-        /*$starttime = strtotime('this week Monday') + 86400*14;
-        $endtime   = $starttime + 86400*14;
+        /*$starttime = strtotime('this week Monday') + (86400*14);
+        $endtime   = $starttime + (86400*14);
         $check = Db::name('lesson_slot')->where('starttime','BETWEEN',[$starttime,$endtime])->find();
         if($check){
             echo '下下周和下下下周有数据了';
@@ -522,7 +522,7 @@ class Plantask extends Controller
 
         //复制本周+下周的课
         $starttime = strtotime('this week Monday'); // 获取本周一的时间戳
-        $endtime   = $starttime + 86400*14;
+        $endtime   = $starttime + (86400*14);
 
         $list = Db::name('lesson_slot')->where('starttime','BETWEEN',[$starttime,$endtime])->order('starttime asc')->select();
         if(empty($list)){
@@ -533,8 +533,8 @@ class Plantask extends Controller
         //到下下周+下下下周
         foreach($list as $key => &$val){
             unset($val['id']);
-            $val['starttime'] = $val['starttime'] + 86400*14;
-            $val['endtime']   = $val['endtime'] + 86400*14;
+            $val['starttime'] = $val['starttime'] + (86400*14);
+            $val['endtime']   = $val['endtime'] + (86400*14);
             $val['bookednum'] = 0;
             $val['status'] = 0;
             $val['notice_status'] = 0;