Commit 6c487670 authored by wangzhengwen's avatar wangzhengwen

update

parent c5fc4692
......@@ -161,14 +161,14 @@ class Course extends BaseController
$data = (new CourseModel())
->with([
'getSections' => function ($query) use ($userId) {
$query->with(['getCourseClass' => function ($query) use ($userId) {
$query->where(['is_sell'=>1,'is_del'=>0]);
$query->with(['fileData', 'courseProgress' => function($query) use ($userId) {
$query->where('user_id', $userId);
}])
->append(['tvtime_str'])
->order('sort', 'desc');
}]);
$query->with(['getCourseClass' => function ($query) use ($userId) {
// $query->where(['is_sell'=>1,'is_del'=>0]);
$query->with(['fileData', 'courseProgress' => function($query) use ($userId) {
$query->where('user_id', $userId);
}])
->append(['tvtime_str'])
->order('sort', 'desc');
}]);
},
'getCourseClass' => function ($query) use ($userId) {
//没有章节的课时查询
......
......@@ -78,6 +78,7 @@ class Project extends BaseController
'p.sn',
'p.id as project_id'
])
->order('pp.id desc')
->with(['project' => ['getuserdata']]);
if (!empty($data['search_str'])) {
......
......@@ -209,10 +209,8 @@ class Course extends Model
public function getCourseClass()
{
return $this->hasMany(\app\model\CourseClass::class, 'course_id','id')
->field('*')
->where('is_del',0)
->where('is_sell',1)
->where('is_sell', 1)
->where('is_del', 0)
->order('sort','desc');
}
......
......@@ -11,6 +11,7 @@ class CourseClassCategory extends Model
{
return $this->hasMany(\app\model\CourseClass::class, 'cate_id','id')
->where('is_del',0)
->where('is_sell', 1)
->order('sort','desc');
// ->field('id,title,cate_id');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment