wupengfei 2 years ago
parent
commit
1f54ddea11

+ 6 - 6
.idea/workspace.xml

@@ -3,10 +3,10 @@
   <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/nutrition/controller/ArticleItem.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/ArticleItem.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/OneArticle.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/OneArticle.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/nutrition/view/article_item/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/article_item/form.html" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/nutrition/view/one_article/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/one_article/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/VideoManage.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/VideoManage.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/controller/VideoUrl.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/VideoUrl.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/video_manage/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/video_manage/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/nutrition/view/video_url/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/view/video_url/form.html" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -181,10 +181,10 @@
     <option name="version" value="1" />
   </component>
   <component name="WindowStateProjectService">
-    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1667959422407">
+    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1667961820348">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
-    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1667959422407" />
+    <state x="1106" y="469" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1667961820348" />
     <state x="283" y="145" width="1942" height="1088" key="DiffContextDialog" timestamp="1666234720909">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>

+ 12 - 1
application/nutrition/controller/VideoManage.php

@@ -2,6 +2,7 @@
 namespace app\Nutrition\controller;
 use app\common\model\DatumIntro;
 use app\common\model\NutritionCase;
+use app\common\model\User;
 use app\common\model\VideoIntro;
 use app\common\model\VideoUrl;
 use hg\apidoc\annotation\explain\Url;
@@ -197,6 +198,10 @@ class VideoManage extends Controller
                 $item_title = input('post.item_title');
                 if(empty($item_title)) $this->error('请上传视频');
             }
+            if(!empty($data['phone'])) {
+                $user_id = User::where('phone',$data['phone'])->value('id');
+                if(!$user_id) $this->error('该手机号未注册');
+            }
         }
     }
 
@@ -204,6 +209,11 @@ class VideoManage extends Controller
         if($this->request->isPost() && in_array($this->request->action(),['add','edit'])) {
             if($this->request->post('type') == 1) {
                 $url = input('post.up_type',1) == 1 ? input('post.up_url'):input('post.path');
+                if(!empty(input('post.phone'))) {
+                    $user_id = User::where('phone',input('post.phone'))->value('id');
+                }else{
+                    $user_id= '';
+                }
                 Data::save('VideoUrl',['video_id'=>$result,
                     'url'=> $url,
                     'cover'=>input('post.cover'),
@@ -216,7 +226,8 @@ class VideoManage extends Controller
                     'up_type'=>input('post.up_type'),
                     'ppt'=>input('post.ppt'),
                     'label'=>input('post.label'),
-                    'user_id'=>input('post.user_id'),
+                    'user_id'=>$user_id,
+                    'phone'=>input('post.phone'),
                     'desc'=>input('post.desc'),
                     'read_num'=>input('post.read_num'),
                 ],'video_id',['video_id'=>$result]);

+ 8 - 0
application/nutrition/controller/VideoUrl.php

@@ -1,6 +1,7 @@
 <?php
 namespace app\Nutrition\controller;
 use app\common\model\DatumIntro;
+use app\common\model\User;
 use app\common\model\VideoIntro;
 use library\Controller;
 use app\common\model\VideoCate;
@@ -136,6 +137,13 @@ class VideoUrl extends Controller
             }else{
                 $data['url'] = $post['path'];
             }
+            if(!empty($post['phone'])) {
+                $user_id = User::where('phone',$post['phone'])->value('id');
+                if(!$user_id) $this->error('该手机号未注册');
+                $data['user_id'] =  $user_id;
+            }else{
+                $data['user_id'] = '';
+            }
         }
 
     }

+ 2 - 2
application/nutrition/view/video_manage/form.html

@@ -111,9 +111,9 @@
 
 
             <div class="layui-form-item">
-                <label class="layui-form-label ">用户ID</label>
+                <label class="layui-form-label ">会员手机号</label>
                 <div class="layui-input-block">
-                    <input name="user_id"   value='{$video_url.user_id|default=""}' placeholder="请输入用户ID" class="layui-input">
+                    <input name="phone"   value='{$video_url.phone|default=""}' placeholder="请输入会员手机号" class="layui-input">
                 </div>
             </div>
 

+ 2 - 2
application/nutrition/view/video_url/form.html

@@ -87,9 +87,9 @@
             </div>
 
             <div class="layui-form-item">
-                <label class="layui-form-label ">用户ID</label>
+                <label class="layui-form-label ">会员手机号</label>
                 <div class="layui-input-block">
-                    <input name="user_id"   value='{$vo.user_id|default=""}' placeholder="请输入用户ID介" class="layui-input">
+                    <input name="phone"   value='{$vo.phone|default=""}' placeholder="请输入会员手机号" class="layui-input">
                 </div>
             </div>