| 
					
				 | 
			
			
				@@ -18,6 +18,31 @@ class Index extends Controller 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //        $this->model = new \app\common\model\Daily(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function task(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $todos = Db::name('todo')->where('org_id',103) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ->where('todo_mode',1)->where('work_type_mode',3) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ->where('create_yyyymmdd',">=",20240920) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ->where('del',0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ->field('id,to_user_id') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ->select(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        dump(count($todos)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $count = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        foreach ($todos as $k=>$v){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $task = Db::name('task')->where('type',1)->where('bus_id',$v['id'])->where('user_id',$v['to_user_id'])->find(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(!$task){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $taskData['start_time'] = getTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $taskData['create_time'] = getTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $taskData['user_id'] = $v['to_user_id']; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $taskData['bus_id'] = $v['id']; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $taskData['org_id'] = 103; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $taskData['type'] = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Db::name('task')->insert($taskData); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                $count++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        halt($count); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public function device() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         set_time_limit(0); 
			 |