作者 郭文星

3122

... ... @@ -97,8 +97,6 @@ class Car extends Base
*/
public function createorder()
{
$user_id = $this->auth;
return $this->success("添加成功", $user_id);
$number = $this->request->param("number");//乘车人数
$phone = $this->request->param("phone");//联系手机号码
$starting_point = $this->request->param("starting_point");//出发位置
... ... @@ -232,16 +230,14 @@ class Car extends Base
$IDcard = $this->request->param("IDcard");
$phone = $this->request->param("phone");
$is_adult = $this->request->param("is_adult");
$user_id = $this->auth;
return $this->success("添加成功", $user_id);
if(!$user_id){
$this->error("添加失败,token失效。".$this->auth->id);
if(!$this->auth->id){
$this->error("添加失败,token失效。");
}
$res = Db::name("passenger")->insert([
"name" => $name,
"IDcard" => $IDcard,
"phone" => $phone,
"user_id" => $user_id,
"user_id" => $this->auth->id,
"is_adult" => $is_adult
]);
return $this->success("添加成功", $res);
... ...