Commit 4f6b7a9a authored by wangzhengwen's avatar wangzhengwen

课程

parent bcd34a6e
...@@ -35,9 +35,11 @@ class CourseUserWork extends BaseController ...@@ -35,9 +35,11 @@ class CourseUserWork extends BaseController
$page = $request->param('page', 1); $page = $request->param('page', 1);
$pageSize = $request->param('pageSize', 10); $pageSize = $request->param('pageSize', 10);
$list = CourseUserWorkModel::where($where)->where('course_user_work.status', '>', 0)->hasWhere('userprofile', $map) $list = CourseUserWorkModel::where($where)
->where('course_user_work.status', '>', 0)
->hasWhere('userprofile', $map)
->order('createtime desc') ->order('createtime desc')
->with(['userprofile']) ->with(['userprofile','course'])
->append(['status_text']) ->append(['status_text'])
->paginate([ ->paginate([
'page' => $page, 'page' => $page,
......
...@@ -231,5 +231,11 @@ class Course extends Model ...@@ -231,5 +231,11 @@ class Course extends Model
->field('fileid,filename,filesize,fileurl,filetype'); ->field('fileid,filename,filesize,fileurl,filetype');
} }
public function courseCategory()
{
return $this->hasMany(\app\model\CourseCategory::class, 'cate_id','id')
->field('id,title');
}
} }
\ No newline at end of file
...@@ -113,7 +113,7 @@ class CourseUserWork extends Model ...@@ -113,7 +113,7 @@ class CourseUserWork extends Model
//关联课程 //关联课程
public function course() public function course()
{ {
return $this->hasOne(Course::class, 'id', 'course_id')->where('is_del', 0)->field('id,title'); return $this->hasOne(Course::class, 'id', 'course_id')->where('is_del', 0)->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