|
@@ -180,6 +180,10 @@ class CourseController
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
+ * 修改审核状态
|
|
|
+ * @return mixed
|
|
|
+ */
|
|
|
|
|
|
* 修改审核状态
|
|
|
* @return mixed
|
|
@@ -187,12 +191,15 @@ class CourseController
|
|
|
public function updateCourseAudit()
|
|
|
{
|
|
|
$course_id = Request::param('course_id');
|
|
|
- $course_audit = Request::param('course_audit');
|
|
|
+ $course = CourseModel::find($course_id);
|
|
|
|
|
|
- $courseModel = new CourseModel();
|
|
|
- $result = $courseModel->updateAuditStatus($course_id, ['course_audit' => $course_audit]);
|
|
|
+ if (!$course) {
|
|
|
+ return app('json')->fail('课程不存在');
|
|
|
+ }
|
|
|
|
|
|
- if ($result !== false) {
|
|
|
+ $course->course_audit = !$course->course_audit;
|
|
|
+
|
|
|
+ if ($course->save()) {
|
|
|
return app('json')->success();
|
|
|
} else {
|
|
|
return app('json')->fail();
|