Commit f8b8a793 authored by wangzhengwen's avatar wangzhengwen

6.12

parent 6bcc3cba
......@@ -41,7 +41,7 @@ class Settled extends BaseController
$user = UserService::getUserInfo($token);
if (!$user)
{
return $this->returnMsg('token无效',0);
return $this->returnMsg('token无效');
}
// if (schoolModel::where('user_id', $user['id'])->count())
......
......@@ -94,6 +94,7 @@ class Cert extends Model
}
$list = $query->field('id,thumb_id,title,createtime,description,shrq,fzjg,price,tag_ids,start_time,end_time')
->with(['thumb'])
->paginate([
'page' => $page,
'list_rows' => $pageSize
......@@ -109,7 +110,13 @@ class Cert extends Model
}
//封面图
public function thumb()
{
return $this->hasOne(SystemUploadFile::class, 'fileid', 'thumb_id')
->where('isdel',0)
->field('fileid,filename,filesize,fileurl,filetype');
}
......
......@@ -101,6 +101,7 @@ class Course extends Model
}
return $query->field('id,thumb,title,createtime,description,price,content')
->with(['thumb'])
->paginate([
'page' => $page,
'list_rows' => $pageSize
......@@ -117,8 +118,8 @@ class Course extends Model
}
$detail = self::where($where)
->with(['getTeacher'=>['thumb'],'thumb'])
->field('id,thumb,title,createtime,description,price,content,teacher_id,tvclick,click')
->with(['getTeacher'=>['thumb'],'thumb','detailThumb'])
->field('id,thumb,title,createtime,description,price,content,teacher_id,tvclick,click,detailthumb')
->find();
if (!$detail)
{
......@@ -179,5 +180,13 @@ class Course extends Model
->field('fileid,filename,filesize,fileurl,filetype');
}
//详情图
public function detailThumb()
{
return $this->hasOne(SystemUploadFile::class, 'fileid', 'detailthumb')
->where('isdel',0)
->field('fileid,filename,filesize,fileurl,filetype');
}
}
\ No newline at end of file
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