|
@@ -102,6 +102,67 @@ class CourseController
|
|
|
}
|
|
|
|
|
|
|
|
|
+// /**
|
|
|
+// * 编辑课程信息
|
|
|
+// * @param Request $request
|
|
|
+// * @return mixed
|
|
|
+// */
|
|
|
+// public function editCourse(Request $request)
|
|
|
+// {
|
|
|
+// $course_id = Request::param('course_id');
|
|
|
+// $course_cate_id = Request::param('course_cate_id');
|
|
|
+// $gr_id = Request::param('gr_id');
|
|
|
+// $sort = Request::param('sort');
|
|
|
+// $course_topic = Request::param('course_topic');
|
|
|
+// $course_price = Request::param('course_price');
|
|
|
+// $course_price2 = Request::param('course_price2');
|
|
|
+// $course_price3 = Request::param('course_price3');
|
|
|
+// $deduct = Request::param('deduct');
|
|
|
+// $course_only_for_employee = Request::param('course_only_for_employee');
|
|
|
+// $make_code = Request::param('make_code');
|
|
|
+// $parent_course = Request::param('parent_course');
|
|
|
+// $ad_pid = Request::param('ad_pid');
|
|
|
+// $course_cover = Request::param('course_cover');
|
|
|
+// $course_speaker_intro = Request::param('course_speaker_intro');
|
|
|
+// $course_play_count = Request::param('course_play_count');
|
|
|
+// $course_intro = Request::param('course_intro');
|
|
|
+// $course_audio = Request::param('course_audio');
|
|
|
+// $course_sp = Request::param('course_sp');
|
|
|
+//
|
|
|
+//
|
|
|
+// $data = [
|
|
|
+// 'course_id' => $course_id,
|
|
|
+// 'course_cate_id' => $course_cate_id,
|
|
|
+// 'gr_id' => $gr_id,
|
|
|
+// 'sort' => $sort,
|
|
|
+// 'course_topic' => $course_topic,
|
|
|
+// 'course_price' => $course_price,
|
|
|
+// 'course_price2' => $course_price2,
|
|
|
+// 'course_price3' => $course_price3,
|
|
|
+// 'deduct' => $deduct,
|
|
|
+// 'course_only_for_employee' => $course_only_for_employee,
|
|
|
+// 'make_code' => $make_code,
|
|
|
+// 'parent_course' => $parent_course,
|
|
|
+// 'ad_pid' => $ad_pid,
|
|
|
+// 'course_cover' => $course_cover,
|
|
|
+// 'course_speaker_intro' => $course_speaker_intro,
|
|
|
+// 'course_play_count' => $course_play_count,
|
|
|
+// 'course_intro' => $course_intro,
|
|
|
+// 'course_audio' => $course_audio,
|
|
|
+// 'course_sp' => $course_sp,
|
|
|
+//
|
|
|
+// ];
|
|
|
+// var_dump($course_speaker_intro);
|
|
|
+//
|
|
|
+// $groupModel = new CourseModel();
|
|
|
+// $result = $groupModel->updateCourse($course_id, $data);
|
|
|
+//
|
|
|
+// if ($result !== false) {
|
|
|
+// return json(['code' => 200, 'msg' => '保存成功']);
|
|
|
+// }
|
|
|
+// return json(['code' => 1, 'msg' => '保存失败']);
|
|
|
+// }
|
|
|
+
|
|
|
/**
|
|
|
* 编辑课程信息
|
|
|
* @param Request $request
|
|
@@ -109,58 +170,34 @@ class CourseController
|
|
|
*/
|
|
|
public function editCourse(Request $request)
|
|
|
{
|
|
|
- $course_id = Request::param('course_id');
|
|
|
- $course_cate_id = Request::param('course_cate_id');
|
|
|
- $gr_id = Request::param('gr_id');
|
|
|
- $sort = Request::param('sort');
|
|
|
- $course_topic = Request::param('course_topic');
|
|
|
- $course_price = Request::param('course_price');
|
|
|
- $course_price2 = Request::param('course_price2');
|
|
|
- $course_price3 = Request::param('course_price3');
|
|
|
- $deduct = Request::param('deduct');
|
|
|
- $course_only_for_employee = Request::param('course_only_for_employee');
|
|
|
- $make_code = Request::param('make_code');
|
|
|
- $parent_course = Request::param('parent_course');
|
|
|
- $ad_pid = Request::param('ad_pid');
|
|
|
- $course_cover = Request::param('course_cover');
|
|
|
- $course_speaker_intro = Request::param('course_speaker_intro');
|
|
|
- $course_play_count = Request::param('course_play_count');
|
|
|
- $course_intro = Request::param('course_intro');
|
|
|
- $course_audio = Request::param('course_audio');
|
|
|
- $course_sp = Request::param('course_sp');
|
|
|
-
|
|
|
-
|
|
|
- $data = [
|
|
|
- 'course_id' => $course_id,
|
|
|
- 'course_cate_id' => $course_cate_id,
|
|
|
- 'gr_id' => $gr_id,
|
|
|
- 'sort' => $sort,
|
|
|
- 'course_topic' => $course_topic,
|
|
|
- 'course_price' => $course_price,
|
|
|
- 'course_price2' => $course_price2,
|
|
|
- 'course_price3' => $course_price3,
|
|
|
- 'deduct' => $deduct,
|
|
|
- 'course_only_for_employee' => $course_only_for_employee,
|
|
|
- 'make_code' => $make_code,
|
|
|
- 'parent_course' => $parent_course,
|
|
|
- 'ad_pid' => $ad_pid,
|
|
|
- 'course_cover' => $course_cover,
|
|
|
- 'course_speaker_intro' => $course_speaker_intro,
|
|
|
- 'course_play_count' => $course_play_count,
|
|
|
- 'course_intro' => $course_intro,
|
|
|
- 'course_audio' => $course_audio,
|
|
|
- 'course_sp' => $course_sp,
|
|
|
-
|
|
|
- ];
|
|
|
- var_dump($course_speaker_intro);
|
|
|
+ $data = $request->param([
|
|
|
+ 'course_id',
|
|
|
+ 'course_cate_id',
|
|
|
+ 'gr_id',
|
|
|
+ 'sort',
|
|
|
+ 'course_topic',
|
|
|
+ 'course_price',
|
|
|
+ 'course_price2',
|
|
|
+ 'course_price3',
|
|
|
+ 'deduct',
|
|
|
+ 'course_only_for_employee',
|
|
|
+ 'make_code',
|
|
|
+ 'parent_course',
|
|
|
+ 'ad_pid',
|
|
|
+ 'course_cover',
|
|
|
+ 'course_speaker_intro',
|
|
|
+ 'course_play_count',
|
|
|
+ 'course_intro',
|
|
|
+ 'course_audio',
|
|
|
+ 'course_sp',
|
|
|
+ ]);
|
|
|
|
|
|
$groupModel = new CourseModel();
|
|
|
- $result = $groupModel->updateCourse($course_id, $data);
|
|
|
+ $result = $groupModel->updateCourse($data['course_id'], $data);
|
|
|
|
|
|
- if ($result !== false) {
|
|
|
- return json(['code' => 200, 'msg' => '保存成功']);
|
|
|
- }
|
|
|
- return json(['code' => 1, 'msg' => '保存失败']);
|
|
|
+ return $result !== false
|
|
|
+ ? json(['code' => 200, 'msg' => '保存成功'])
|
|
|
+ : json(['code' => 1, 'msg' => '保存失败']);
|
|
|
}
|
|
|
|
|
|
|