正在显示
1 个修改的文件
包含
4 行增加
和
2 行删除
@@ -230,14 +230,16 @@ class Car extends Base | @@ -230,14 +230,16 @@ class Car extends Base | ||
230 | $IDcard = $this->request->param("IDcard"); | 230 | $IDcard = $this->request->param("IDcard"); |
231 | $phone = $this->request->param("phone"); | 231 | $phone = $this->request->param("phone"); |
232 | $is_adult = $this->request->param("is_adult"); | 232 | $is_adult = $this->request->param("is_adult"); |
233 | - if(!$this->auth->id){ | 233 | + $user_id = $this->auth->id; |
234 | + print_r($user_id);return; | ||
235 | + if(!$user_id){ | ||
234 | $this->error("添加失败,token失效。".$this->auth->id); | 236 | $this->error("添加失败,token失效。".$this->auth->id); |
235 | } | 237 | } |
236 | $res = Db::name("passenger")->insert([ | 238 | $res = Db::name("passenger")->insert([ |
237 | "name" => $name, | 239 | "name" => $name, |
238 | "IDcard" => $IDcard, | 240 | "IDcard" => $IDcard, |
239 | "phone" => $phone, | 241 | "phone" => $phone, |
240 | - "user_id" => $this->auth->id, | 242 | + "user_id" => $user_id, |
241 | "is_adult" => $is_adult | 243 | "is_adult" => $is_adult |
242 | ]); | 244 | ]); |
243 | return $this->success("添加成功", $res); | 245 | return $this->success("添加成功", $res); |
-
请 注册 或 登录 后发表评论