Zxc 1 år sedan
förälder
incheckning
f26b99d794

+ 0 - 40
app/api/controller/Education.php

@@ -44,45 +44,6 @@ class Education
     }
 
 
-//    /**
-//     * 获取课程详情
-//     * @param $gr_id
-//     * @return mixed
-//     * @throws \think\db\exception\DataNotFoundException
-//     * @throws \think\db\exception\DbException
-//     * @throws \think\db\exception\ModelNotFoundException
-//     */
-//    public function getCourseDetail($gr_id)
-//    {
-//        $course = EducationCourse::where('gr_id', $gr_id)
-//            ->where('course_status', 1)
-//            ->where('course_audit', 1)
-//            ->find();
-//
-//        if (!$course) {
-//            return app('json')->fail('课程不存在');
-//        }
-//
-//        $course = $course->toArray();
-//
-//        $education = \app\model\api\Education::where('gr_id', $course['gr_id'])
-//            ->where('audit', 1)
-//            ->find();
-//
-//        if (!$education) {
-//            return app('json')->fail('课程不存在或未通过审核');
-//        }
-//
-//        $education = $education->toArray();
-//
-//        $course['edu_name'] = $education['name'];
-//        $course['edu_logo'] = $education['logo'];
-//        $course['edu_type1'] = $education['type1'];
-//        $course['edu_type2'] = $education['type2'];
-//
-//        return app('json')->success($course);
-//    }
-
 
     /**
      * 获取轮播列表
@@ -138,7 +99,6 @@ class Education
             ->where('course_audit', 1)
             ->select();
 
-//        return app('json')->success($courseList);
         return json([
             'code' => 200,
             'msg' => 'ok',

+ 3 - 2
app/api/controller/User.php

@@ -437,7 +437,7 @@ class User extends BaseController
         $save['minority']        = empty($post["minority"])       ? "": $post["minority"];
 
 
-        $save["status"] = 0;
+        $save["status"] = 1;
         $save["time"]   = time();
         $save["uid"]    = $request->user["uid"];
         $save['is_china'] = $post["is_china"];
@@ -462,7 +462,8 @@ class User extends BaseController
             $no = "MYJ" . date("ym") . $id;
         }
         (new InfoAudit)->where("id", $r)->update(["no" => $no]);
-        return app('json')->success("提交成功,请耐心等待审核");
+        (new InfoAudit)->where("id", $r)->update(["status" => 1]);
+        return app('json')->success("提交成功,数据已通过审核");
     }
     /**
      * 平台认证

+ 86 - 49
app/system/controller/CourseController.php

@@ -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' => '保存失败']);
     }