panda 3 kuukautta sitten
vanhempi
commit
8b70151978

+ 4 - 5
application/api/controller/Examine.php

@@ -35,7 +35,7 @@ class Examine extends Api
             ->autopage()
             ->select();
         foreach ($list as $k => $v) {
-            $list[$k]['apply']            = !empty($v['apply']) ? 1 : 0;
+            $list[$k]['apply'] = !empty($v['apply']) ? 1 : 0;
         }
         return $this->success('success', $list);
     }
@@ -46,10 +46,10 @@ class Examine extends Api
         if (empty($params['examine_id'])) {
             return $this->error('参数缺失');
         }
-        if (empty($v['name'])) {
+        if (empty($params['name'])) {
             return $this->error('报名信息姓名不能为空');
         }
-        if (empty($v['phone'])) {
+        if (empty($params['phone'])) {
             return $this->error('报名信息手机号不能为空');
         }
         $user_id = $this->auth->id;
@@ -72,7 +72,7 @@ class Examine extends Api
         // 开始报名
         $data = [
             'user_id'     => $user_id,
-            'examine_id'   => $params['examine_id'],
+            'examine_id'  => $params['examine_id'],
             'order_no'    => createUniqueNo('E', $user_id),
             'name'        => $params['name'],
             'phone'       => $params['phone'],
@@ -85,7 +85,6 @@ class Examine extends Api
             Db::rollback();
             return $this->error('订单创建失败');
         }
-
         Db::commit();
         return $this->success('报名成功');
     }

+ 2 - 2
application/api/controller/UniversityCourse.php

@@ -68,10 +68,10 @@ class UniversityCourse extends Api
         if (empty($params['course_id'])) {
             return $this->error('参数缺失');
         }
-        if (empty($v['name'])) {
+        if (empty($params['name'])) {
             return $this->error('报名信息姓名不能为空');
         }
-        if (empty($v['phone'])) {
+        if (empty($params['phone'])) {
             return $this->error('报名信息手机号不能为空');
         }
         $user_id = $this->auth->id;