Swdz-WangHaiJun 4 سال پیش
والد
کامیت
f02b1a4d6f
1فایلهای تغییر یافته به همراه4 افزوده شده و 7 حذف شده
  1. 4 7
      app/Admin/Actions/Device/sendRule.php

+ 4 - 7
app/Admin/Actions/Device/sendRule.php

xqd xqd
@@ -18,16 +18,12 @@ class sendRule extends RowAction
 
     public function handle(Model $model, Request $request)
     {
-        set_time_limit(300);
+        set_time_limit(600);
         $id = $this->row->id;
         $device_name = $this->row->device_name;
         if(empty($device_name)) return true;
         $iot_id = $this->row->iot_id;
         $res = (new DeviceServer())->getDeviceStatus($iot_id);
-
-        if($res != 0){
-
-        }
         $lock_info = LockInfo::where(['device_id'=>$id,'status'=>1])->orderBy('box_type','asc')->get()->GroupBy('box_type');
         foreach ($lock_info as $key=>$lock){
             if(empty($lock)) continue;
@@ -54,9 +50,10 @@ class sendRule extends RowAction
                 Log::info('设备名称'.$device_name.' 下发协议结果:'.'--------'.json_encode($res).PHP_EOL);
 
                 sleep('22');
-                    if($res['Success'] == true){
                       LockInfo::where(['device_id'=>$id,'box_type'=>$key])->update(['send_status'=>2]);
-                    }
+                if($res['Success'] == true){
+                  LockInfo::where(['device_id'=>$id,'box_type'=>$key])->update(['send_status'=>2]);
+                }
                 Log::info('执行规则'.json_encode($send_rule).PHP_EOL);
             }
         }