LiberoFile

155 经验值

@sodasix 在返回的json,object指向的是空数组。

    $obj = new Object;
    $obj->object_id = $objectId;
    $obj->object_lt_x = $objX;
    $obj->object_lt_y = $objY;
    $obj->object_width = $objWidth;
    $obj->object_height = $objHeight;
    $obj->image_id = $imageId;
    $obj->type_id = $typeId;
    if ($obj->save()) {
        $obj_id = $obj->object_id;
        $object = DB::table('objects')->where('object_id',$objectId)->get();
        $success = array('status' => 1,'message' => $type_name.'标记成功!','obj_id' => $obj_id,'object' => $object);
        return response()->json($success);
    } else {
        $error = array('status' => 0,'message' => $type_name.'标记失败!');
        return response()->json($error);
    }

将数据插入到表中后,提示插入成功,用软件查询也可以查询得到,但是,在要删除的时候却找不到刚插入的记录,但是刷新网页后就可以正常删除,请问是什么原因?