|
@@ -1,13 +1,10 @@
|
|
|
<?php
|
|
|
namespace app\Nutrition\controller;
|
|
|
use app\common\model\DatumIntro;
|
|
|
-use app\common\model\VideoIntro;
|
|
|
-use app\common\model\VideoUrl;
|
|
|
use library\Controller;
|
|
|
-use app\common\model\VideoCate as VCM;
|
|
|
/**
|
|
|
* 资料管理
|
|
|
- * Class VideoManage
|
|
|
+ * Class UserDatum
|
|
|
* @package app\Nutrition\controller
|
|
|
*/
|
|
|
class UserDatum extends Controller
|
|
@@ -32,8 +29,8 @@ class UserDatum extends Controller
|
|
|
public function index()
|
|
|
{
|
|
|
$this->title = '资料列表';
|
|
|
- $video_cate = VCM::field('id,title')->select()->toArray();
|
|
|
- $this->video_cate = array_column($video_cate,null,'id');
|
|
|
+ $datum_cate = \app\common\model\DatumCate::field('id,title')->select()->toArray();
|
|
|
+ $this->datum_cate = array_column($datum_cate,null,'id');
|
|
|
$sel_where = [];
|
|
|
$sel_where[] = ['v.is_deleted','=',0];
|
|
|
if($title = $this->request->get('title')) $sel_where[] = ['v.title','like','%'.$title.'%'];
|
|
@@ -118,15 +115,15 @@ class UserDatum extends Controller
|
|
|
$series_id = input('post.series_id');
|
|
|
$sort = input('post.sort');
|
|
|
$is_vip = input('post.is_vip');
|
|
|
- $user_video = \app\common\model\UserDatum::where(['id' => $id])->find()->toArray();
|
|
|
+ $user_datum = \app\common\model\UserDatum::where(['id' => $id])->find()->toArray();
|
|
|
\app\common\model\DatumUrl::create([
|
|
|
'datum_id'=>$series_id,
|
|
|
- 'url'=>$user_video['datum_url'],
|
|
|
+ 'url'=>$user_datum['datum_url'],
|
|
|
'sort'=>$sort,
|
|
|
'is_vip'=>$is_vip,
|
|
|
'source'=>2,
|
|
|
'rel_id'=>$id,
|
|
|
- 'title'=>$user_video['title'],
|
|
|
+ 'title'=>$user_datum['title'],
|
|
|
]);
|
|
|
$this->success('添加成功!');
|
|
|
}
|