wupengfei 2 år sedan
förälder
incheckning
3020c21235

+ 11 - 10
.idea/workspace.xml

@@ -3,7 +3,8 @@
   <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/UserCenter.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/UserCenter.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/model/UserFacility.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/model/UserFacility.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/user/controller/Member.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/user/controller/Member.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -121,7 +122,7 @@
   <component name="PropertiesComponent">
     <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
     <property name="WebServerToolWindowFactoryState" value="false" />
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/../dineng" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/../shoupiao" />
     <property name="node.js.detected.package.eslint" value="true" />
     <property name="node.js.detected.package.tslint" value="true" />
     <property name="node.js.path.for.package.eslint" value="project" />
@@ -217,7 +218,8 @@
       <workItem from="1673312216057" duration="9503000" />
       <workItem from="1673399011843" duration="19253000" />
       <workItem from="1673485061294" duration="18259000" />
-      <workItem from="1673571454158" duration="8480000" />
+      <workItem from="1673571454158" duration="9346000" />
+      <workItem from="1674867530758" duration="4070000" />
     </task>
     <servers />
   </component>
@@ -347,10 +349,10 @@
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     <state x="283" y="145" width="1942" height="1088" key="DiffContextDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1673485770540" />
-    <state x="1418" y="514" key="FileChooserDialogImpl" timestamp="1673420027516">
+    <state x="1418" y="514" key="FileChooserDialogImpl" timestamp="1674870871901">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
-    <state x="1418" y="514" key="FileChooserDialogImpl/0.0.2560.1400@0.0.2560.1400" timestamp="1673420027516" />
+    <state x="1418" y="514" key="FileChooserDialogImpl/0.0.2560.1400@0.0.2560.1400" timestamp="1674870871901" />
     <state x="1051" y="472" key="MultipleFileMergeDialog" timestamp="1671416392056">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
@@ -371,15 +373,14 @@
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     <state x="793" y="524" key="VcsDiffUtil.ChangesDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1667975468009" />
-    <state x="533" y="290" key="com.intellij.ide.util.TipDialog" timestamp="1673571470349">
+    <state x="533" y="290" key="com.intellij.ide.util.TipDialog" timestamp="1674867547851">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
-    <state x="533" y="290" key="com.intellij.ide.util.TipDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1673571470349" />
-    <state x="1166" y="605" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1673505904775">
+    <state x="533" y="290" key="com.intellij.ide.util.TipDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1674867547851" />
+    <state x="1166" y="605" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1674867555927">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
-    <state x="875" y="449" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/0.0.1920.1040@0.0.1920.1040" timestamp="1665835639346" />
-    <state x="1166" y="605" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/0.0.2560.1400@0.0.2560.1400" timestamp="1673505904775" />
+    <state x="1166" y="605" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/0.0.2560.1400@0.0.2560.1400" timestamp="1674867555927" />
     <state x="1440" y="372" width="829" height="548" key="find.popup" timestamp="1673516892258">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>

+ 6 - 0
application/common/model/UserFacility.php

@@ -19,4 +19,10 @@ class UserFacility extends Model
         return $check_info->facility == $facility ? true : false;
 
     }
+
+    // 验证设备号是否设置过
+    public static function checkSetFacility($user_id,$type,$facility){
+        return self::where(['user_id'=>$user_id,'type'=>$type,'facility'=>$facility])->value('id');
+    }
+
 }

+ 2 - 1
application/user/controller/Member.php

@@ -284,7 +284,8 @@ class Member extends Controller
         }else{
             list($data) = [$this->request->post()];
             for ($i=1;$i<=4;$i++) {
-                if(isset($data['facility_'.$i])){
+                $check_facility = UserFacility::where($data['user_id'],$i,$data['facility_'.$i]);
+                if(isset($data['facility_'.$i]) && !$check_facility){
                     Data::save(
                         'UserFacility',
                         ['user_id'=>$data['user_id'],'type'=>$i,'facility'=>$data['facility_'.$i],'set_time'=>date('Y-m-d H:i:s')],