Commit 6c487670 authored by wangzhengwen's avatar wangzhengwen

update

parent c5fc4692
...@@ -162,7 +162,7 @@ class Course extends BaseController ...@@ -162,7 +162,7 @@ class Course extends BaseController
->with([ ->with([
'getSections' => function ($query) use ($userId) { 'getSections' => function ($query) use ($userId) {
$query->with(['getCourseClass' => function ($query) use ($userId) { $query->with(['getCourseClass' => function ($query) use ($userId) {
$query->where(['is_sell'=>1,'is_del'=>0]); // $query->where(['is_sell'=>1,'is_del'=>0]);
$query->with(['fileData', 'courseProgress' => function($query) use ($userId) { $query->with(['fileData', 'courseProgress' => function($query) use ($userId) {
$query->where('user_id', $userId); $query->where('user_id', $userId);
}]) }])
......
...@@ -78,6 +78,7 @@ class Project extends BaseController ...@@ -78,6 +78,7 @@ class Project extends BaseController
'p.sn', 'p.sn',
'p.id as project_id' 'p.id as project_id'
]) ])
->order('pp.id desc')
->with(['project' => ['getuserdata']]); ->with(['project' => ['getuserdata']]);
if (!empty($data['search_str'])) { if (!empty($data['search_str'])) {
......
...@@ -209,10 +209,8 @@ class Course extends Model ...@@ -209,10 +209,8 @@ class Course extends Model
public function getCourseClass() public function getCourseClass()
{ {
return $this->hasMany(\app\model\CourseClass::class, 'course_id','id') return $this->hasMany(\app\model\CourseClass::class, 'course_id','id')
->field('*') ->where('is_sell', 1)
->where('is_del', 0)
->where('is_del',0)
->where('is_sell',1)
->order('sort','desc'); ->order('sort','desc');
} }
......
...@@ -11,6 +11,7 @@ class CourseClassCategory extends Model ...@@ -11,6 +11,7 @@ class CourseClassCategory extends Model
{ {
return $this->hasMany(\app\model\CourseClass::class, 'cate_id','id') return $this->hasMany(\app\model\CourseClass::class, 'cate_id','id')
->where('is_del',0) ->where('is_del',0)
->where('is_sell', 1)
->order('sort','desc'); ->order('sort','desc');
// ->field('id,title,cate_id'); // ->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