正在显示
1 个修改的文件
包含
3 行增加
和
7 行删除
| @@ -97,8 +97,6 @@ class Car extends Base | @@ -97,8 +97,6 @@ class Car extends Base | ||
| 97 | */ | 97 | */ |
| 98 | public function createorder() | 98 | public function createorder() |
| 99 | { | 99 | { |
| 100 | - $user_id = $this->auth; | ||
| 101 | - return $this->success("添加成功", $user_id); | ||
| 102 | $number = $this->request->param("number");//乘车人数 | 100 | $number = $this->request->param("number");//乘车人数 |
| 103 | $phone = $this->request->param("phone");//联系手机号码 | 101 | $phone = $this->request->param("phone");//联系手机号码 |
| 104 | $starting_point = $this->request->param("starting_point");//出发位置 | 102 | $starting_point = $this->request->param("starting_point");//出发位置 |
| @@ -232,16 +230,14 @@ class Car extends Base | @@ -232,16 +230,14 @@ class Car extends Base | ||
| 232 | $IDcard = $this->request->param("IDcard"); | 230 | $IDcard = $this->request->param("IDcard"); |
| 233 | $phone = $this->request->param("phone"); | 231 | $phone = $this->request->param("phone"); |
| 234 | $is_adult = $this->request->param("is_adult"); | 232 | $is_adult = $this->request->param("is_adult"); |
| 235 | - $user_id = $this->auth; | ||
| 236 | - return $this->success("添加成功", $user_id); | ||
| 237 | - if(!$user_id){ | ||
| 238 | - $this->error("添加失败,token失效。".$this->auth->id); | 233 | + if(!$this->auth->id){ |
| 234 | + $this->error("添加失败,token失效。"); | ||
| 239 | } | 235 | } |
| 240 | $res = Db::name("passenger")->insert([ | 236 | $res = Db::name("passenger")->insert([ |
| 241 | "name" => $name, | 237 | "name" => $name, |
| 242 | "IDcard" => $IDcard, | 238 | "IDcard" => $IDcard, |
| 243 | "phone" => $phone, | 239 | "phone" => $phone, |
| 244 | - "user_id" => $user_id, | 240 | + "user_id" => $this->auth->id, |
| 245 | "is_adult" => $is_adult | 241 | "is_adult" => $is_adult |
| 246 | ]); | 242 | ]); |
| 247 | return $this->success("添加成功", $res); | 243 | return $this->success("添加成功", $res); |
-
请 注册 或 登录 后发表评论