wupengfei 2 лет назад
Родитель
Сommit
b09671ff52

+ 1 - 0
.idea/workspace.xml

@@ -3,6 +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/nutrition/controller/UserVideo.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/UserVideo.php" 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" />

+ 7 - 0
application/nutrition/controller/UserVideo.php

@@ -1,5 +1,6 @@
 <?php
 namespace app\Nutrition\controller;
+use app\common\model\User;
 use app\common\model\UserMessage;
 use app\common\model\VideoIntro;
 use app\common\model\VideoUrl;
@@ -176,6 +177,7 @@ class UserVideo extends Controller
             $sort = input('post.sort');
             $is_vip = input('post.is_vip');
             $user_video = \app\common\model\UserVideo::where(['id' => $id])->find()->toArray();
+            $user_info = User::where('id',$user_video['user_id'])->find()->toArray();
             VideoUrl::create([
                 'video_id'=>$series_id,
                 'cover'=>$user_video['cover'],
@@ -185,6 +187,8 @@ class UserVideo extends Controller
                 'source'=>2,
                 'rel_id'=>$id,
                 'title'=>$user_video['title'],
+                'user_id'=>$user_video['user_id'],
+                'phone'=>$user_info['phone'] ? $user_info['phone']:$user_info['email'],
             ]);
             VideoIntro::where('id',$series_id)->setInc('url_num');
             $this->success('添加成功!');
@@ -203,6 +207,7 @@ class UserVideo extends Controller
         }else{
             $user_video_id= input('user_video_id');
             $user_video = \app\common\model\UserVideo::where('id',$user_video_id)->find()->toArray();
+            $user_info = User::where('id',$user_video['user_id'])->find()->toArray();
             $new_video = [
                 'title' => $user_video['title'],
                 'content' => $user_video['desc'],
@@ -224,6 +229,8 @@ class UserVideo extends Controller
                 'source' => 2,
                 'title' => $new_video['title'],
                 'rel_id' => $user_video_id,
+                'user_id'=>$user_video['user_id'],
+                'phone'=>$user_info['phone'] ? $user_info['phone']:$user_info['email'],
             ];
             Data::save('VideoUrl',$video_item,'video_id',['video_id' => $result->id]);
             $this->success('创建成功');

+ 3 - 3
application/nutrition/controller/VideoManage.php

@@ -199,8 +199,8 @@ class VideoManage extends Controller
                 if(empty($item_title)) $this->error('请上传视频');
             }
             if(!empty($data['phone'])) {
-                $user_id = User::where('phone',$data['phone'])->value('id');
-                if(!$user_id) $this->error('该手机号未注册');
+                $user_id = User::where('phone|email',$data['phone'])->value('id');
+                if(!$user_id) $this->error('该号未注册');
             }
         }
     }
@@ -210,7 +210,7 @@ class VideoManage extends Controller
             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');
+                    $user_id = User::where('phone|email',input('post.phone'))->value('id');
                 }else{
                     $user_id= '';
                 }

+ 2 - 2
application/nutrition/controller/VideoUrl.php

@@ -138,8 +138,8 @@ class VideoUrl extends Controller
                 $data['url'] = $post['path'];
             }
             if(!empty($post['phone'])) {
-                $user_id = User::where('phone',$post['phone'])->value('id');
-                if(!$user_id) $this->error('该手机号未注册');
+                $user_id = User::where('phone|email',$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 ">会员手机号</label>
+                <label class="layui-form-label ">会员号</label>
                 <div class="layui-input-block">
-                    <input name="phone"   value='{$video_url.phone|default=""}' placeholder="请输入会员手机号" 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 ">会员手机号</label>
+                <label class="layui-form-label ">会员号</label>
                 <div class="layui-input-block">
-                    <input name="phone"   value='{$vo.phone|default=""}' placeholder="请输入会员手机号" class="layui-input">
+                    <input name="phone"   value='{$vo.phone|default=""}' placeholder="请输入会员会员账号" class="layui-input">
                 </div>
             </div>