wupengfei 2 years ago
parent
commit
4cea0a46f7
2 changed files with 12 additions and 2 deletions
  1. 2 2
      .idea/workspace.xml
  2. 10 0
      application/api/controller/Task.php

+ 2 - 2
.idea/workspace.xml

@@ -3,7 +3,7 @@
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/api/controller/Base.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Base.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Task.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Task.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -212,7 +212,7 @@
       <workItem from="1672880479757" duration="22897000" />
       <workItem from="1672966192005" duration="19617000" />
       <workItem from="1673052319155" duration="16867000" />
-      <workItem from="1673226266250" duration="13782000" />
+      <workItem from="1673226266250" duration="14059000" />
     </task>
     <servers />
   </component>

+ 10 - 0
application/api/controller/Task.php

@@ -3,6 +3,7 @@ namespace app\api\controller;
 
 use app\common\model\LabelMessage;
 use app\common\model\User;
+use app\common\model\UserFacility;
 use app\common\model\UserMessage;
 use app\common\model\UserSearch;
 
@@ -66,6 +67,15 @@ class Task extends Base
         }
     }
 
+    /**
+     * @title 半年清理一次设备号
+     * @desc
+     * @author  qc
+     * @url /api/Task/removeFacility
+     */
+    public function removeFacility(){
+        UserFacility::where(['set_time','> time',date('Y-m-d H:i:s',strtotime('-180 days'))])->update(['facility'=>'','set_time'=>date('Y-m-d H:i:s')]);
+    }