|
@@ -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]);
|