hzd 5 months ago
parent
commit
f45315cbd5
2 changed files with 28 additions and 0 deletions
  1. 3 0
      application/common/model/Wlps.php
  2. 25 0
      application/index/controller/Index.php

+ 3 - 0
application/common/model/Wlps.php

@@ -166,8 +166,11 @@ class Wlps extends Base
             }
 
             // 添加任务到任务表
+            $taskData['start_time'] = getTime();
+            $taskData['create_time'] = getTime();
             $taskData['user_id'] = $data['to_user_id'];
             $taskData['bus_id'] = $todoid;
+            $taskData['org_id'] = $this->orgId;
             $taskData['type'] = 1;
             $res = Db::name('task')
                 ->insert($taskData);

+ 25 - 0
application/index/controller/Index.php

@@ -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);