wupengfei 2 years ago
parent
commit
bc8247165a
2 changed files with 4 additions and 2 deletions
  1. 1 2
      .idea/workspace.xml
  2. 3 0
      application/nutrition/controller/Learn.php

+ 1 - 2
.idea/workspace.xml

@@ -4,7 +4,6 @@
     <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/nutrition/controller/Learn.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/Learn.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/nutrition/view/learn/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/learn/form.html" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -194,7 +193,7 @@
       <workItem from="1669682447842" duration="24394000" />
       <workItem from="1669769873624" duration="5352000" />
       <workItem from="1669776182613" duration="18162000" />
-      <workItem from="1669855685721" duration="18584000" />
+      <workItem from="1669855685721" duration="18717000" />
     </task>
     <servers />
   </component>

+ 3 - 0
application/nutrition/controller/Learn.php

@@ -64,6 +64,8 @@ class Learn extends Controller
         if($this->request->isGet() && $this->request->action() == 'edit')
         {
             $info  = UserLearn::where('id',input('id'))->find()->toArray();
+            $user_info = User::where('id',$info['user_id'])->find()->toArray();
+            $data['phone'] = $user_info['phone'] ? $user_info['phone'] : $user_info['email'];
             $this->first_id =$info['first_id'];
             $this->second_id =$info['second_id'];
             $this->type =$info['type'];
@@ -72,6 +74,7 @@ class Learn extends Controller
            $phone = input('phone');
            $user_id = User::where('phone|email',$phone)->value('id');
            if(!$user_id)$this->error('用户不存在');
+           if(!empty($data['end_time']))$this->error('请选择时间');
            $data['user_id'] = $user_id;
            if(isset($data['end_time'])) $data['end_int'] = strtotime($data['end_time']);
         }