zhangguidong před 2 roky
rodič
revize
503bd1a3cc
1 změnil soubory, kde provedl 6 přidání a 3 odebrání
  1. 6 3
      application/api/controller/Notification.php

+ 6 - 3
application/api/controller/Notification.php

@@ -127,7 +127,7 @@ class Notification extends Api
         $message_model = new \app\admin\model\Message();
         $user_model = new  \app\admin\model\User();
         $sms_model =new Sms();
-        $order_list = $order_model->where('status',2)->select();
+        $order_list = $order_model->where('status',2)->where('is_send',1)->select();
         foreach ($order_list as &$v) {
             $now = strtotime($date . $v['sta'] . ':00');
             $tixing = $now-$time;
@@ -150,6 +150,7 @@ class Notification extends Api
                         'createtime' => time(),];
                     $message_model->insert($message_data);
                 }
+            $order_model->isUpdate('true', ['id' => $v['id']])->save(['is_send' =>2 ]);
         }
     }
 
@@ -160,7 +161,7 @@ class Notification extends Api
         $message_model = new \app\admin\model\Message();
         $user_model = new  \app\admin\model\User();
         $sms_model =new Sms();
-        $order_list = $order_model->where('status',2)->select();
+        $order_list = $order_model->where('status',2)->where('is_sendd',1)->select();
         foreach ($order_list as &$v) {
             $now = strtotime($date . $v['end'] . ':00');
             $tixing = $now-$time;
@@ -184,7 +185,9 @@ class Notification extends Api
                         'createtime' => time(),];
                     $message_model->insert($message_data);
                 }
-            }
+            $order_model->isUpdate('true', ['id' => $v['id']])->save(['is_sendd' =>2 ]);
+
+        }
 
     }
     public function method_time(){